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

CustomError doesn't work when using Worker #4

Closed
nguyenyou opened this issue Sep 1, 2024 · 0 comments
Closed

CustomError doesn't work when using Worker #4

nguyenyou opened this issue Sep 1, 2024 · 0 comments

Comments

@nguyenyou
Copy link
Contributor

nguyenyou commented Sep 1, 2024

Related issue: pinojs/thread-stream#29

In short, the custom error PdfEngineError after sending back to the main thread will become Error and we lose all the custom fields.

export class PdfEngineError extends Error {
    /**
     * Error code
     */
    code?: number;
    /**
     *
     * @param message - error message
     * @param code - error code
     */
    constructor(message: string, code?: number);
}

As a workaround, I think I will put the code as part of the message.

@jichang jichang closed this as completed in 785511c Sep 2, 2024
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