diff --git a/package.json b/package.json index 93e779d7d..1719d96a3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "misskey", - "version": "2024.3.1-io.5", + "version": "2024.3.1-io.5a", "codename": "nasubi", "repository": { "type": "git", diff --git a/packages/backend/src/server/api/endpoints/users/get-skeb-status.ts b/packages/backend/src/server/api/endpoints/users/get-skeb-status.ts index f2e103665..87782539d 100644 --- a/packages/backend/src/server/api/endpoints/users/get-skeb-status.ts +++ b/packages/backend/src/server/api/endpoints/users/get-skeb-status.ts @@ -134,16 +134,24 @@ export default class extends Endpoint { // eslint- if (res.status > 299 || (json.error ?? json.ban_reason)) { logger.error('Skeb status response error', { url: url.href, userId: ps.userId, status: res.status, statusText: res.statusText, error: json.error ?? json.ban_reason }); - if (res.status === 404 && hasSkebRole) await this.roleService.unassign(ps.userId, this.config.skebStatus.roleId); + try { + if (res.status === 404 && hasSkebRole) await this.roleService.unassign(ps.userId, this.config.skebStatus.roleId); + } catch (err) { + logger.error('Failed to unassign role', { userId: ps.userId, roleId: this.config.skebStatus.roleId, error: err }); + } throw new ApiError(meta.errors.noSuchUser); } logger.info('Skeb status response', { url: url.href, userId: ps.userId, status: res.status, statusText: res.statusText, skebStatus: json }); - if (json.is_acceptable) { - if (!hasSkebRole) await this.roleService.assign(ps.userId, this.config.skebStatus.roleId); - } else if (hasSkebRole) { - await this.roleService.unassign(ps.userId, this.config.skebStatus.roleId); + try { + if (json.is_acceptable) { + if (!hasSkebRole) await this.roleService.assign(ps.userId, this.config.skebStatus.roleId); + } else if (hasSkebRole) { + await this.roleService.unassign(ps.userId, this.config.skebStatus.roleId); + } + } catch (err) { + logger.error('Failed to assign/unassign role', { userId: ps.userId, roleId: this.config.skebStatus.roleId, error: err }); } return { diff --git a/packages/misskey-js/package.json b/packages/misskey-js/package.json index 39e33544b..72b3760ff 100644 --- a/packages/misskey-js/package.json +++ b/packages/misskey-js/package.json @@ -1,7 +1,7 @@ { "type": "module", "name": "misskey-js", - "version": "2024.3.1-io.5", + "version": "2024.3.1-io.5a", "description": "Misskey SDK for JavaScript", "types": "./built/dts/index.d.ts", "exports": {