Skip to content

Commit

Permalink
feat:#85 Google插件扩展-错误处理
Browse files Browse the repository at this point in the history
  • Loading branch information
terwer committed Sep 25, 2022
1 parent e7a8c46 commit e1b449c
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/lib/platform/metaweblog/CustomMetaweblogApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,10 @@ export class CustomMetaWeblogApi {

let ret = await this.xmlrpcClient.methodCallEntry(METAWEBLOG_METHOD_CONSTANTS.NEW_POST,
[this.apiType, username, password, postStruct, publish])
logUtil.logInfo("newPost ret=>", ret)

// 错误处理
this.doFault(ret)

let retStr = ret.params.param.value.string || ""
logUtil.logInfo("newPost retStr=>", retStr.toString())
Expand All @@ -217,6 +221,9 @@ export class CustomMetaWeblogApi {
const ret = await this.xmlrpcClient.methodCallEntry(METAWEBLOG_METHOD_CONSTANTS.EDIT_POST,
[postid, username, password, postStruct, publish])

// 错误处理
this.doFault(ret)

let retBool = ret.params.param.value.boolean || ""
logUtil.logInfo("editPost retBool=>", retBool)

Expand All @@ -227,6 +234,9 @@ export class CustomMetaWeblogApi {
const ret = await this.xmlrpcClient.methodCallEntry(METAWEBLOG_METHOD_CONSTANTS.DELETE_POST,
[appKey, postid, username, password, publish])

// 错误处理
this.doFault(ret)

let retBool = ret.params.param.value.boolean || ""
logUtil.logInfo("deletePost retBool=>", retBool)

Expand Down

0 comments on commit e1b449c

Please sign in to comment.