Skip to content
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,7 @@ describe('ApiBase', () => {
await Qminder.ApiBase.queryGraph(ME_ID.request);
}).rejects.toThrow(
new ResponseValidationError(
`Server response is not valid GraphQL response. Response: {}`,
'Error occurred! Could not extract error message!',
),
);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import {
isSuccessResponse,
} from '../../model/graphql-response.js';
import { RequestInit } from '../../model/fetch.js';
import { ResponseValidationError } from '../../model/errors/response-validation-error.js';

type RequestInitWithMethodRequired = Pick<RequestInit, 'method' | 'headers'> & {
body?: string | File | object;
Expand Down Expand Up @@ -151,11 +150,7 @@ export class ApiBase {
return graphQLResponse.data;
}

throw new ResponseValidationError(
`Server response is not valid GraphQL response. Response: ${JSON.stringify(
graphQLResponse,
)}`,
);
throw this.extractError(graphQLResponse);
}

private static extractError(response: any): Error {
Expand Down
Loading