Skip to content

Add static string getters for calendar and ixdtf errors #6904

@Manishearth

Description

@Manishearth

Currently, temporal_rs has an error type that contains a kind and a Cow message, alongside an error message enum that's being worked on (probably will do some more refactoring there).

In temporal_capi, and V8, this gets turned in to a kind and a &'static str error. This avoids the extra conditional free FFI call.

This mostly works: 99% of errors are static strings. However, errors arising from ICU4X or ixdtf are not, we call Display on them and store the string.

It would be nice if ixdtf and calendar errors had a way to get a static string message that contains most of the info.

Alternatively, we should consider having the temporal_capi errors be opaque types. I'd like to avoid this, but I suspect the cost we are avoiding is not much.

cc @nekevss @robertbastian @sffc

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions