Skip to content
This repository has been archived by the owner on Jan 26, 2022. It is now read-only.

AggregateError.prototype.toString #36

Closed
bakkot opened this issue Sep 4, 2019 · 5 comments
Closed

AggregateError.prototype.toString #36

bakkot opened this issue Sep 4, 2019 · 5 comments

Comments

@bakkot
Copy link
Collaborator

bakkot commented Sep 4, 2019

From #33:

AggregateError.prototype.toString: should this exist and do something different than Error.prototype.toString?

I think it would be useful to have it report messages from the underlying errors, though I'm not sure exactly what that ought to look like. It could at least report the number of errors it is wrapping, failing that.

cc @ljharb

@ljharb
Copy link
Member

ljharb commented Sep 5, 2019

I would hope it toStrings each item of the array so as to maximize usefulness in debugging, but a count of errors would be a good minimum.

@ljharb ljharb mentioned this issue Sep 8, 2019
5 tasks
@chicoxyzzy
Copy link
Member

This has been implemented in #37 with number of errors. PTAL at commit: 44b1c52

@ljharb
Copy link
Member

ljharb commented Oct 13, 2019

@mathiasbynens at this point, it seems that AggregateError.prototype.toString is identical to Error.prototype.toString - should they be ===? Or, should there be something about errors mentioned in AggregateError.prototype.toString?

@devsnek
Copy link
Member

devsnek commented Nov 11, 2019

Error#toString and AggregateError#toString are identical except for the default name value (Error vs AggregateError). For consistency, it would probably be best to only have Error#toString, and then an internal slot or something could override the default name value.

@devsnek
Copy link
Member

devsnek commented Nov 11, 2019

Actually thinking about this more, I don't think there is even a need for overriding the default. AggregateError#toString should probably just be removed.

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

No branches or pull requests

5 participants