Skip to content

Commit

Permalink
address PR feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
rozenmd committed Feb 5, 2024
1 parent 3ddc296 commit 1e28bfe
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions packages/wrangler/src/d1/execute.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -151,12 +151,10 @@ export const Handler = async (args: HandlerOptions): Promise<void> => {
logger.log(JSON.stringify(response, null, 2));

Check warning on line 151 in packages/wrangler/src/d1/execute.tsx

View check run for this annotation

Codecov / codecov/patch

packages/wrangler/src/d1/execute.tsx#L150-L151

Added lines #L150 - L151 were not covered by tests
}
} catch (error) {
if (json) {
if (json && error instanceof Error) {
logger.loggerLevel = existingLogLevel;
const messageToDisplay =
(error as Error).name === "APIError"
? error
: { text: (error as Error).message };
error.name === "APIError" ? error : { text: error.message };
throw new JsonFriendlyFatalError(
JSON.stringify({ error: messageToDisplay }, null, 2)
);
Expand Down

0 comments on commit 1e28bfe

Please sign in to comment.