Skip to content

Commit f5f3c2e

Browse files
committed
fix(webapp): stop logging expected auth/restore conditions as errors
1 parent 43b4936 commit f5f3c2e

3 files changed

Lines changed: 14 additions & 5 deletions

File tree

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
area: webapp
3+
type: improvement
4+
---
5+
6+
Log expected auth-code and checkpoint-restore conditions at `warn` instead of `error`.

apps/webapp/app/routes/api.v1.token.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,13 @@ export async function action({ request }: ActionFunctionArgs) {
3737
return json(responseJson);
3838
} catch (error) {
3939
if (error instanceof Error) {
40-
logger.error("Error getting PersonalAccessToken from AuthorizationCode", {
41-
url: request.url,
42-
error: error.message,
43-
});
40+
const expected = error.message === "Invalid authorization code, or code expired";
41+
const fields = { url: request.url, error: error.message };
42+
if (expected) {
43+
logger.warn("Error getting PersonalAccessToken from AuthorizationCode", fields);
44+
} else {
45+
logger.error("Error getting PersonalAccessToken from AuthorizationCode", fields);
46+
}
4447

4548
return json({ error: error.message }, { status: 400 });
4649
}

apps/webapp/app/v3/services/restoreCheckpoint.server.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ export class RestoreCheckpointService extends BaseService {
8282
});
8383

8484
if (restoreEvent) {
85-
logger.error("Restore event already exists", {
85+
logger.warn("Restore event already exists", {
8686
runId: checkpoint.runId,
8787
attemptId: checkpoint.attemptId,
8888
checkpointId: checkpoint.id,

0 commit comments

Comments
 (0)