Closed Rich-Harris closed 3 days ago
We talked about this a while back that error and warning should share the same shape and therefore we could also make them share the same base class. But yes it may make sense to revisit this.
So are we saying that CompileDiagnostic
shouldn't extend Error
now? If so, we definitely spoke about this and agreed that we wanted this behaviour.
I don't recall that conversation, though I did apparently merge https://github.com/sveltejs/svelte/pull/12326. Why would we want warnings to extend Error
? The user doesn't need to know the stack
, that's just noise. (Honestly this is true for errors as well — how weird would it be if CompileError
didn't extend Error
?)
Describe the bug
CompileWarning
extendsError
and I see no reason why it should — it should just be a POJO (maybe with a conveniencetoString()
method). Found this while trying topostMessage
a warning from a worker and finding themessage
got stripped outReproduction
later
Logs
No response
System Info
Severity
annoyance