Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 33 additions & 6 deletions api/error.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,36 @@
export type NotMemberError = {
/** Scrapbox REST APIが返すエラーの型 */
export interface ErrorLike {
/** error name */ name: string;
/** error message */ message: string;
}

/** 参加していないprivate projectに対してAPIを叩いたときに発生するエラー */
export interface NotMemberError extends ErrorLike {
name: "NotMemberError";
message: string;
};
}

export type NotFoundError = {
/** 指定したprojectやpageが見つからないときに発生するエラー */
export interface NotFoundError extends ErrorLike {
name: "NotFoundError";
message: string;
};
}

/** owner/admin権限が不足しているときに発生するエラー */
export interface NotPrivilegeError extends ErrorLike {
name: "NotPrivilegeError";
}

/** Loginが必要なAPIをloginせずに叩いたときに発生するエラー */
export interface NotLoggedInError extends ErrorLike {
name: "NotLoggedInError";
/** 詳細情報 */ details: {
/** 使用できるログイン方法 */ loginStrategies: (
| "google"
| "github"
| "microsoft"
| "gyazo"
| "email"
| "saml"
| "easy-trial"
)[];
};
}