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 77 * @markdown-confluence/lib bumped from 3.0.4 to 3.0.0
88 * @markdown-confluence/mermaid-electron-renderer bumped from 3.0.4 to 3.0.0
99
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+
1025## [ 5.3.0] ( https://github.com/markdown-confluence/markdown-confluence/compare/obsidian-confluence-v5.2.6...obsidian-confluence-v5.3.0 ) (2023-05-11)
1126
1227
Original file line number Diff line number Diff line change 11{
22 "id" : " confluence-integration" ,
33 "name" : " Confluence Integration" ,
4- "version" : " 5.3 .0" ,
4+ "version" : " 5.4 .0" ,
55 "minAppVersion" : " 1.0.0" ,
66 "description" : " This plugin allows you to publish your notes to Confluence" ,
77 "author" : " andymac4182" ,
Original file line number Diff line number Diff line change 11{
22 "name" : " obsidian-confluence" ,
3- "version" : " 5.3 .0" ,
3+ "version" : " 5.4 .0" ,
44 "description" : " This library allows you to publish your notes to Confluence" ,
55 "main" : " main.js" ,
66 "type" : " module" ,
2424 "mime-types" : " ^2.1.35" ,
2525 "react" : " ^16.14.0" ,
2626 "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"
2929 },
3030 "resolutions" : {
3131 "prosemirror-model" : " 1.14.3"
Original file line number Diff line number Diff line change @@ -145,12 +145,19 @@ export class MyBaseClient implements Client {
145145 body : requestBody [ 1 ] ,
146146 method : requestConfig . method ?. toUpperCase ( ) ?? "GET" ,
147147 contentType : requestContentType ,
148- throw : true ,
148+ throw : false ,
149149 } ;
150150 delete modifiedRequestConfig . data ;
151151
152152 const response = await requestUrl ( modifiedRequestConfig ) ;
153153
154+ if ( response . status >= 400 ) {
155+ throw new HTTPError ( `Received a ${ response . status } ` , {
156+ status : response . status ,
157+ data : response . text ,
158+ } ) ;
159+ }
160+
154161 const callbackResponseHandler =
155162 callback && ( ( data : T ) : void => callback ( null , data ) ) ;
156163 const defaultResponseHandler = ( data : T ) : T => data ;
@@ -184,6 +191,20 @@ export class MyBaseClient implements Client {
184191 }
185192}
186193
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+
187208export class ObsidianConfluenceClient
188209 extends MyBaseClient
189210 implements RequiredConfluenceClient
Original file line number Diff line number Diff line change @@ -80,6 +80,16 @@ export default class ConfluencePlugin extends Plugin {
8080 apiToken : this . settings . atlassianApiToken ,
8181 } ,
8282 } ,
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+ } ,
8393 } ) ;
8494
8595 const settingsLoader = new StaticSettingsLoader ( this . settings ) ;
You can’t perform that action at this time.
0 commit comments