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
37 changes: 35 additions & 2 deletions error.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,33 @@
* `name`はないことがある
*/
export interface ErrorLike {
/** error name */ name: string;
/** error message */ message: string;
/** error name */
name: string;
/** error message */
message: string;
}

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

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

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

/** Loginが必要なAPIをloginせずに叩いたときに発生するエラー */
export interface NotLoggedInError extends ErrorLike {
/** error name */
name: "NotLoggedInError";

/** 詳細情報 */
Expand All @@ -46,6 +52,7 @@ export interface NotLoggedInError extends ErrorLike {

/** CSRF tokenが不正なときに発生するエラー */
export interface SessionError extends ErrorLike {
/** error name */
name: "SessionError";
}

Expand All @@ -54,11 +61,13 @@ export interface SessionError extends ErrorLike {
* 実際のresponseではmessageしか返ってこないことに注意
*/
export interface InvalidURLError extends ErrorLike {
/** error name */
name: "InvalidURLError";
}

/** URL先ページから正常な応答が返ってこなかったときのエラー */
export interface BadRequestError extends ErrorLike {
/** error name */
name: "BadRequestError";
}

Expand All @@ -67,5 +76,29 @@ export interface BadRequestError extends ErrorLike {
* 実際のresponseではmessageしか返ってこないことに注意
*/
export interface NoQueryError extends ErrorLike {
/** error name */
name: "NoQueryError";
}
/** 不正なfollowingIdを渡されたときに発生するエラー
*
* 実際のresponseではmessageしか返ってこないことに注意
*/
export interface InvalidFollowingIdError extends ErrorLike {
name: "InvalidFollowingIdError";
}

/** 容量を使い切ったときに発生するerror
*
* 実際のresponseではmessageしか返ってこないことに注意
*/
export interface FileCapacityError extends ErrorLike {
name: "FileCapacityError";
}

/** Google Cloud Storage XML APIのerror
*
* `message`には[この形式](https://cloud.google.com/storage/docs/xml-api/reference-status#http-status-and-error-codes)のXMLが入る
*/
export interface GCSError extends ErrorLike {
name: "GCSError";
}