File tree Expand file tree Collapse file tree
packages/javascript-api/src/lib/services/api-base Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -522,7 +522,7 @@ describe('ApiBase', () => {
522522 await Qminder . ApiBase . queryGraph ( ME_ID . request ) ;
523523 } ) . rejects . toThrow (
524524 new ResponseValidationError (
525- `Server response is not valid GraphQL response. Response: {}` ,
525+ 'Error occurred! Could not extract error message!' ,
526526 ) ,
527527 ) ;
528528 } ) ;
Original file line number Diff line number Diff line change 88 isSuccessResponse ,
99} from '../../model/graphql-response.js' ;
1010import { RequestInit } from '../../model/fetch.js' ;
11- import { ResponseValidationError } from '../../model/errors/response-validation-error.js' ;
1211
1312type RequestInitWithMethodRequired = Pick < RequestInit , 'method' | 'headers' > & {
1413 body ?: string | File | object ;
@@ -151,11 +150,7 @@ export class ApiBase {
151150 return graphQLResponse . data ;
152151 }
153152
154- throw new ResponseValidationError (
155- `Server response is not valid GraphQL response. Response: ${ JSON . stringify (
156- graphQLResponse ,
157- ) } `,
158- ) ;
153+ throw this . extractError ( graphQLResponse ) ;
159154 }
160155
161156 private static extractError ( response : any ) : Error {
You can’t perform that action at this time.
0 commit comments