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

fix: createError fallback to statusMessage #25

Merged
merged 1 commit into from
Jun 23, 2021
Merged

fix: createError fallback to statusMessage #25

merged 1 commit into from
Jun 23, 2021

Conversation

antfu
Copy link
Member

@antfu antfu commented Jun 23, 2021

Currently, when using Nuxt, the createError does not generate meaningful error messages if only statusMessage is provided (which I see is more commonly been used in the Nuxt code base)

image

I would think it could be better to serve statusMessage if message is not provided. Ideally, maybe we could have better format as `${input.statusCode}: ${input.statusMessage}` but I will leave it for discussions

@codecov-commenter
Copy link

Codecov Report

Merging #25 (82026e2) into main (8d39032) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##             main      #25   +/-   ##
=======================================
  Coverage   93.95%   93.95%           
=======================================
  Files          10       10           
  Lines         182      182           
  Branches       49       42    -7     
=======================================
  Hits          171      171           
  Misses         11       11           
Impacted Files Coverage Δ
src/error.ts 89.65% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8d39032...82026e2. Read the comment docs.

@pi0
Copy link
Member

pi0 commented Jun 23, 2021

Thanks!

@pi0 pi0 merged commit 2f792f5 into unjs:main Jun 23, 2021
@antfu antfu deleted the patch-1 branch June 23, 2021 10:26
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.

4 participants