Skip to content

Commit

Permalink
Add typed error response
Browse files Browse the repository at this point in the history
  • Loading branch information
reneklacan committed Feb 9, 2024
1 parent 07c05f8 commit f265403
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/lib/api/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export { CancelablePromise, CancelError } from "./core/CancelablePromise"
export { OpenAPI } from "./core/OpenAPI"
export type { OpenAPIConfig } from "./core/OpenAPI"

export type { ErrorResponse } from "./models/ErrorResponse"
export { Leaderboard } from "./models/Leaderboard"
export type { LeaderboardDumpResponse } from "./models/LeaderboardDumpResponse"
export type { LeaderboardEntryHistory } from "./models/LeaderboardEntryHistory"
Expand Down
11 changes: 11 additions & 0 deletions src/lib/api/models/ErrorResponse.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/* generated using openapi-typescript-codegen -- do no edit */
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export type ErrorResponse = {
code: number
error: string
full_error?: Array<string>
backtrace?: Array<string>
full_backtrace?: Array<string>
}
1 change: 1 addition & 0 deletions src/lib/api/services/LeaderboardEntriesApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export class LeaderboardEntriesApi {
},
errors: {
404: `Player leaderboard entry was not found`,
500: `Server error`,
},
})
}
Expand Down
6 changes: 6 additions & 0 deletions src/lib/api/services/LeaderboardsApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ export class LeaderboardsApi {
order: order,
query: query,
},
errors: {
500: `Server error`,
},
})
}
/**
Expand All @@ -47,6 +50,9 @@ export class LeaderboardsApi {
return __request(OpenAPI, {
method: "GET",
url: "/v0/leaderboards/ranked_1v1/dump",
errors: {
500: `Server error`,
},
})
}
}
3 changes: 3 additions & 0 deletions src/lib/api/services/MatchesApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ export class MatchesApi {
count: count,
state: state,
},
errors: {
500: `Server error`,
},
})
}
}
8 changes: 8 additions & 0 deletions src/lib/api/services/PlayersApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ export class PlayersApi {
},
errors: {
404: `Player was not found`,
500: `Server error`,
},
})
}
Expand All @@ -56,6 +57,7 @@ export class PlayersApi {
},
errors: {
404: `Player was not found`,
500: `Server error`,
},
})
}
Expand All @@ -79,6 +81,7 @@ export class PlayersApi {
},
errors: {
404: `Player was not found`,
500: `Server error`,
},
})
}
Expand All @@ -102,6 +105,7 @@ export class PlayersApi {
},
errors: {
404: `Player was not found`,
500: `Server error`,
},
})
}
Expand Down Expand Up @@ -129,6 +133,7 @@ export class PlayersApi {
mediaType: "application/json",
errors: {
404: `Player was not found`,
500: `Server error`,
},
})
}
Expand All @@ -152,6 +157,7 @@ export class PlayersApi {
},
errors: {
404: `Player was not found`,
500: `Server error`,
},
})
}
Expand All @@ -175,6 +181,7 @@ export class PlayersApi {
},
errors: {
404: `Player was not found`,
500: `Server error`,
},
})
}
Expand Down Expand Up @@ -203,6 +210,7 @@ export class PlayersApi {
},
errors: {
404: `Player was not found`,
500: `Server error`,
},
})
}
Expand Down
3 changes: 3 additions & 0 deletions src/lib/api/services/StatisticsApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ export class StatisticsApi {
query: {
league: league,
},
errors: {
500: `Server error`,
},
})
}
}

0 comments on commit f265403

Please sign in to comment.