Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error #649

Merged
merged 3 commits into from
Nov 26, 2024
Merged

error #649

merged 3 commits into from
Nov 26, 2024

Conversation

vicb
Copy link
Contributor

@vicb vicb commented Nov 26, 2024

No description provided.

OPEN_NEXT_ERROR_LOG_LEVEL is the minimal error level from which internal errors are logged.
It can be set to
- "0" / "debug"
- "1" / "warn" (default)
- "2" / "error"
Copy link

changeset-bot bot commented Nov 26, 2024

🦋 Changeset detected

Latest commit: 1f9cbe8

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@opennextjs/aws Minor
app-pages-router Patch
app-router Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vicb vicb requested a review from conico974 November 26, 2024 09:13
if (error.logLevel === 0) {
// Display the name and the message instead of full Open Next errors.
return debug(
...args.map((arg) =>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@conico974 the code does not display the full exception here and for level 1. Let me know what you think about that.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's good, as long as we have the message it's fine

Copy link
Contributor

github-actions bot commented Nov 26, 2024

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 22.76% 1723 / 7569
🔵 Statements 22.76% 1723 / 7569
🔵 Functions 57.92% 106 / 183
🔵 Branches 71.38% 439 / 615
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
packages/open-next/src/adapters/logger.ts 91.42% 80.64% 71.42% 91.42% 5-6, 38-40, 46
packages/open-next/src/utils/error.ts 100% 100% 100% 100%
Generated in workflow #784 for commit 1f9cbe8 by the Vitest Coverage Report Action

Copy link

pkg-pr-new bot commented Nov 26, 2024

Open in Stackblitz

pnpm add https://pkg.pr.new/@opennextjs/aws@649

commit: 1f9cbe8

Copy link
Contributor

@conico974 conico974 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One little thing, but otherwise LGTM

if (error.logLevel === 0) {
// Display the name and the message instead of full Open Next errors.
return debug(
...args.map((arg) =>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's good, as long as we have the message it's fine

return;
}
if (error.logLevel === 0) {
// Display the name and the message instead of full Open Next errors.
return debug(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably add some kind of warning just before this line in case openNextDebug is not set, otherwise there will be no error logged and it might be confusing for people.
Or we just use console.log or console.error and rely entirely on OPEN_NEXT_ERROR_LOG_LEVEL

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea.
+1 to drop openNextDebug

@vicb vicb requested a review from conico974 November 26, 2024 09:57
Copy link
Contributor

@conico974 conico974 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM Thanks

@vicb
Copy link
Contributor Author

vicb commented Nov 26, 2024

Thanks for the review!

@vicb vicb merged commit 2b2a48b into main Nov 26, 2024
3 checks passed
@vicb vicb deleted the error branch November 26, 2024 10:07
@@ -1,4 +1,4 @@
import type { BaseOpenNextError } from "utils/error";
import { type BaseOpenNextError, isOpenNextError } from "utils/error";
Copy link
Contributor

@sommeeeer sommeeeer Nov 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that BaseOpenNextError is not used anywhere in this file?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch -> #653

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants