Skip to content

Maximum call stack size exceeded #324

@alanshaw

Description

@alanshaw

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions