Skip to content

Commit

Permalink
fix linting
Browse files Browse the repository at this point in the history
  • Loading branch information
fredex42 committed Oct 14, 2024
1 parent ede4a1c commit 2065327
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions fronts-client/src/services/recipeQuery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,13 @@ const setupRecipeThumbnails = (recep: Recipe) => {
};

const recipeQuery = (baseUrl: string) => {
const captureErrors = (status:number, content:string, url:string) => {
const existingContext = Raven.getContext()
Raven.setUserContext({...existingContext, recipeSearchResponse: content});
Raven.captureMessage(`${url} returned ${status}`)
const captureErrors = (status: number, content: string, url: string) => {
const existingContext = Raven.getContext();
Raven.setUserContext({ ...existingContext, recipeSearchResponse: content });
Raven.captureMessage(`${url} returned ${status}`);
Raven.setUserContext(existingContext);
console.error(content);
}
};

const fetchOne = async (href: string): Promise<Recipe | undefined> => {
const response = await fetch(`${baseUrl}${href}`);
Expand Down Expand Up @@ -196,7 +196,11 @@ const recipeQuery = (baseUrl: string) => {
);
if (indexResponse.status != 200) {
const content = await indexResponse.text();
captureErrors(indexResponse.status, content, `/recipes/api/content/by-uid?ids=${idsToFind.join(',')}`);
captureErrors(
indexResponse.status,
content,
`/recipes/api/content/by-uid?ids=${idsToFind.join(',')}`,
);
throw new Error(
`Unable to retrieve partial index: server error ${indexResponse.status}`,
);
Expand Down

0 comments on commit 2065327

Please sign in to comment.