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

Maximum call stack size exceeded #324

Open
alanshaw opened this issue Oct 11, 2023 · 0 comments
Open

Maximum call stack size exceeded #324

alanshaw opened this issue Oct 11, 2023 · 0 comments

Comments

@alanshaw
Copy link
Member

e.g.

import * as Server from '@ucanto/server'

class StoreItemNotFound extends Server.Failure {
  get name () {
    return 'StoreItemNotFound'
  }
}

In a handler, returning new StoreItemNotFound() will cause a Maximum call stack size exceeded error, since Server.Failure's getter for message calls describe(), which calls toString(), which by default will access message i.e. a loop:

Screenshot 2023-10-11 at 11 09 56
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

No branches or pull requests

1 participant