File tree Expand file tree Collapse file tree 5 files changed +51
-5
lines changed Expand file tree Collapse file tree 5 files changed +51
-5
lines changed Original file line number Diff line number Diff line change 7
7
* @markdown-confluence/lib bumped from 3.0.4 to 3.0.0
8
8
* @markdown-confluence/mermaid-electron-renderer bumped from 3.0.4 to 3.0.0
9
9
10
+ ## [ 5.4.0] ( https://github.com/markdown-confluence/markdown-confluence/compare/obsidian-confluence-v5.3.0...obsidian-confluence-v5.4.0 ) (2023-05-12)
11
+
12
+
13
+ ### Features
14
+
15
+ * Handle 404 when pageId included in YAML. Set to not publish and remove bad pageId ([ 33dde01] ( https://github.com/markdown-confluence/markdown-confluence/commit/33dde014ccc24368f065eec0a92dba3755644fc8 ) )
16
+
17
+
18
+ ### Dependencies
19
+
20
+ * The following workspace dependencies were updated
21
+ * dependencies
22
+ * @markdown-confluence/lib bumped from 5.3.0 to 5.4.0
23
+ * @markdown-confluence/mermaid-electron-renderer bumped from 5.3.0 to 5.4.0
24
+
10
25
## [ 5.3.0] ( https://github.com/markdown-confluence/markdown-confluence/compare/obsidian-confluence-v5.2.6...obsidian-confluence-v5.3.0 ) (2023-05-11)
11
26
12
27
Original file line number Diff line number Diff line change 1
1
{
2
2
"id" : " confluence-integration" ,
3
3
"name" : " Confluence Integration" ,
4
- "version" : " 5.3 .0" ,
4
+ "version" : " 5.4 .0" ,
5
5
"minAppVersion" : " 1.0.0" ,
6
6
"description" : " This plugin allows you to publish your notes to Confluence" ,
7
7
"author" : " andymac4182" ,
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " obsidian-confluence" ,
3
- "version" : " 5.3 .0" ,
3
+ "version" : " 5.4 .0" ,
4
4
"description" : " This library allows you to publish your notes to Confluence" ,
5
5
"main" : " main.js" ,
6
6
"type" : " module" ,
24
24
"mime-types" : " ^2.1.35" ,
25
25
"react" : " ^16.14.0" ,
26
26
"react-dom" : " ^16.14.0" ,
27
- "@markdown-confluence/lib" : " 5.3 .0" ,
28
- "@markdown-confluence/mermaid-electron-renderer" : " 5.3 .0"
27
+ "@markdown-confluence/lib" : " 5.4 .0" ,
28
+ "@markdown-confluence/mermaid-electron-renderer" : " 5.4 .0"
29
29
},
30
30
"resolutions" : {
31
31
"prosemirror-model" : " 1.14.3"
Original file line number Diff line number Diff line change @@ -145,12 +145,19 @@ export class MyBaseClient implements Client {
145
145
body : requestBody [ 1 ] ,
146
146
method : requestConfig . method ?. toUpperCase ( ) ?? "GET" ,
147
147
contentType : requestContentType ,
148
- throw : true ,
148
+ throw : false ,
149
149
} ;
150
150
delete modifiedRequestConfig . data ;
151
151
152
152
const response = await requestUrl ( modifiedRequestConfig ) ;
153
153
154
+ if ( response . status >= 400 ) {
155
+ throw new HTTPError ( `Received a ${ response . status } ` , {
156
+ status : response . status ,
157
+ data : response . text ,
158
+ } ) ;
159
+ }
160
+
154
161
const callbackResponseHandler =
155
162
callback && ( ( data : T ) : void => callback ( null , data ) ) ;
156
163
const defaultResponseHandler = ( data : T ) : T => data ;
@@ -184,6 +191,20 @@ export class MyBaseClient implements Client {
184
191
}
185
192
}
186
193
194
+ export interface ErrorData {
195
+ data : unknown ;
196
+ status : number ;
197
+ }
198
+
199
+ export class HTTPError extends Error {
200
+ constructor ( msg : string , public response : ErrorData ) {
201
+ super ( msg ) ;
202
+
203
+ // Set the prototype explicitly.
204
+ Object . setPrototypeOf ( this , HTTPError . prototype ) ;
205
+ }
206
+ }
207
+
187
208
export class ObsidianConfluenceClient
188
209
extends MyBaseClient
189
210
implements RequiredConfluenceClient
Original file line number Diff line number Diff line change @@ -80,6 +80,16 @@ export default class ConfluencePlugin extends Plugin {
80
80
apiToken : this . settings . atlassianApiToken ,
81
81
} ,
82
82
} ,
83
+ middlewares : {
84
+ onError ( e ) {
85
+ if ( "response" in e && "data" in e . response ) {
86
+ e . message =
87
+ typeof e . response . data === "string"
88
+ ? e . response . data
89
+ : JSON . stringify ( e . response . data ) ;
90
+ }
91
+ } ,
92
+ } ,
83
93
} ) ;
84
94
85
95
const settingsLoader = new StaticSettingsLoader ( this . settings ) ;
You can’t perform that action at this time.
0 commit comments