Skip to content

Commit

Permalink
refactor: simplify err handling
Browse files Browse the repository at this point in the history
  • Loading branch information
fearandesire committed Nov 4, 2024
1 parent 767543c commit ee14961
Showing 1 changed file with 2 additions and 14 deletions.
16 changes: 2 additions & 14 deletions src/utils/api/Khronos/props/propsApiWrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,23 +59,11 @@ export default class PropsApiWrapper {
* @returns A promise that resolves to the raw response from the API
*/
async setResult(params: SetPropResultRequest) {
try {
return await this.propsApi.setPropResult(params);
} catch (error: any) {
if (error?.response) {
const errorData = await error.response.json();
throw new Error(errorData.message);
}
throw error;
}
return await this.propsApi.setPropResult(params);
}

async getPropsByPlayer(params: FindPropsByDescriptionRequest) {
try {
return await this.propsApi.findPropsByDescription(params);
} catch (error: any) {
throw error;
}
return await this.propsApi.findPropsByDescription(params);
}

async getStatsProps() {
Expand Down

0 comments on commit ee14961

Please sign in to comment.