File tree Expand file tree Collapse file tree 2 files changed +2
-13
lines changed
Expand file tree Collapse file tree 2 files changed +2
-13
lines changed Original file line number Diff line number Diff line change 11import axios from "axios" ;
2- import { apiErrorHandler } from "./errorHandler" ;
32
43export const commandApi = {
54 getCommand : async ( leafUrl : string ) : Promise < any > => {
@@ -99,11 +98,7 @@ export const commandApi = {
9998 arg : string ;
10099 } ,
101100 ) : Promise < any > => {
102- try {
103- const response = await axios . post ( subresourceUrl , data ) ;
104- return response . data ;
105- } catch ( err : any ) {
106- apiErrorHandler . handleApiError ( err , "Failed to create subresource" ) ;
107- }
101+ const response = await axios . post ( subresourceUrl , data ) ;
102+ return response . data ;
108103 } ,
109104} as const ;
Original file line number Diff line number Diff line change @@ -11,10 +11,4 @@ export const apiErrorHandler = {
1111 isHttpError : ( err : any , statusCode : number ) : boolean => {
1212 return err . response ?. status === statusCode ;
1313 } ,
14-
15- handleApiError : ( err : any , context : string = "" ) : never => {
16- console . error ( context , err ) ;
17- const message = apiErrorHandler . getErrorMessage ( err ) ;
18- throw new Error ( message ) ;
19- } ,
2014} as const ;
You can’t perform that action at this time.
0 commit comments