Open Bug 1839676 Opened 1 year ago Updated 1 year ago

[meta] Improve error messages for Temporal

Categories

(Core :: JavaScript: Standard Library, task, P3)

task

Tracking

()

People

(Reporter: anba, Unassigned)

References

(Depends on 1 open bug, Blocks 1 open bug)

Details

(Keywords: meta)

Improve the error messages for Temporal. For example when parsing fails in TemporalParser, the error message could include (parts of) the input string to give better feedback which part couldn't be parsed:

js> Temporal.Instant.from("2023-01-01T00:00[UTC]")
typein:1:18 RangeError: missing time zone
Stack:
  @typein:1:18
js> Temporal.Instant.from("2023-01-01T00:00Z[UTC]").toString()
"2023-01-01T00:00:00Z"

Just reporting "RangeError: missing time zone" isn't helpful, in this specific case the error message could indicate that either a time zone offset or Z must be present before the time zone annotation.

Error message improvements should happen in individual bugs that block this bug.

Summary: Improve error messages for Temporal → [meta] Improve error messages for Temporal
See Also: → 1840326
Depends on: 1840326
Severity: -- → S3
Priority: -- → P3
You need to log in before you can comment on or make changes to this bug.