fix
This commit is contained in:
parent
c90c32d62a
commit
e612fbf831
|
@ -4,6 +4,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { permissions } from 'misskey-js';
|
import { permissions } from 'misskey-js';
|
||||||
|
import type { ApiErrorInput } from '@/server/api/error.js';
|
||||||
import type { KeyOf, Schema } from '@/misc/json-schema.js';
|
import type { KeyOf, Schema } from '@/misc/json-schema.js';
|
||||||
|
|
||||||
import * as ep___admin_abuseReport_notificationRecipient_list
|
import * as ep___admin_abuseReport_notificationRecipient_list
|
||||||
|
@ -780,11 +781,7 @@ interface IEndpointMetaBase {
|
||||||
readonly tags?: ReadonlyArray<string>;
|
readonly tags?: ReadonlyArray<string>;
|
||||||
|
|
||||||
readonly errors?: {
|
readonly errors?: {
|
||||||
readonly [key: string]: {
|
readonly [key: string]: ApiErrorInput;
|
||||||
readonly message: string;
|
|
||||||
readonly code: string;
|
|
||||||
readonly id: string;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
readonly res?: Schema;
|
readonly res?: Schema;
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
* SPDX-License-Identifier: AGPL-3.0-only
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
*/
|
*/
|
||||||
|
|
||||||
type E = { message: string, code: string, id: string, kind?: 'client' | 'server' | 'permission', httpStatusCode?: number };
|
export type ApiErrorInput = { message: string, code: string, id: string, kind?: 'client' | 'server' | 'permission', httpStatusCode?: number };
|
||||||
|
|
||||||
export class ApiError extends Error {
|
export class ApiError extends Error {
|
||||||
public message: string;
|
public message: string;
|
||||||
|
@ -13,7 +13,7 @@ export class ApiError extends Error {
|
||||||
public httpStatusCode?: number;
|
public httpStatusCode?: number;
|
||||||
public info?: any;
|
public info?: any;
|
||||||
|
|
||||||
constructor(err?: E | null | undefined, info?: any | null | undefined) {
|
constructor(err?: ApiErrorInput | null | undefined, info?: any | null | undefined) {
|
||||||
if (err == null) err = {
|
if (err == null) err = {
|
||||||
message: 'Internal error occurred. Please contact us if the error persists.',
|
message: 'Internal error occurred. Please contact us if the error persists.',
|
||||||
code: 'INTERNAL_ERROR',
|
code: 'INTERNAL_ERROR',
|
||||||
|
|
Loading…
Reference in New Issue