Skip to content

Commit 0cedeeb

Browse files
committed
Update manifest for release.
1 parent 90f3d1a commit 0cedeeb

File tree

5 files changed

+51
-5
lines changed

5 files changed

+51
-5
lines changed

CHANGELOG.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,21 @@
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

manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
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",

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
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",
@@ -24,8 +24,8 @@
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"

src/MyBaseClient.ts

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff 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+
187208
export class ObsidianConfluenceClient
188209
extends MyBaseClient
189210
implements RequiredConfluenceClient

src/main.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff 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);

0 commit comments

Comments
 (0)