Skip to content

Commit

Permalink
fix(api): also throw errors for other error cases in cdp route
Browse files Browse the repository at this point in the history
  • Loading branch information
lemilonkh committed Jul 17, 2024
1 parent c79539b commit 5fbe4c8
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions app/src/app/api/v0/inventory/[inventory]/cdp/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -208,13 +208,17 @@ export const POST = apiHandler(async (_req, { session, params }) => {
}
} catch (error) {
logger.error(`Failed to submit response: ${error}`);
success = false;
throw new createHttpError.FailedDependency(
"CDP API response error: " + error,
);
}
} else if (CDPService.mode === "production") {
// TODO: Submit total emissions
// TODO: Submit CIRIS file
// TODO: Submit emissions matrix
success = false;
throw new createHttpError.InternalServerError(
"CDP service is set to production mode, which is not yet implemented.",
);
}

return NextResponse.json({
Expand Down

0 comments on commit 5fbe4c8

Please sign in to comment.