Skip to content
Merged
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
8 changes: 6 additions & 2 deletions tempo/src/model/tempo-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,12 @@ export interface QueryOptions {

export const executeRequest = async <T>(...args: Parameters<typeof global.fetch>): Promise<T> => {
const response = await fetch(...args);
const jsonData = await response.json();
return jsonData;
try {
return await response.json();
} catch (e) {
console.error('Invalid response from server', e);
throw new Error('Invalid response from server');
}
};

function fetchWithGet<T, TResponse>(apiURI: string, params: T | null, queryOptions: QueryOptions): Promise<TResponse> {
Expand Down