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

add a constructor to AuthHttpError class #161

Closed
wants to merge 1 commit into from
Closed

add a constructor to AuthHttpError class #161

wants to merge 1 commit into from

Conversation

FabienDehopre
Copy link

This fixes the issue #160

@chenkie
Copy link
Contributor

chenkie commented Sep 13, 2016

Thanks for this. Tests are passing?

@FabienDehopre
Copy link
Author

I did run the command npm run test and all the tests executed successfully.

@FabienDehopre
Copy link
Author

In fact, this will not solve the issue for the moment because it seems that browsers don't allow extending built-in class for the moment.
See these issues in TypeScript repo:
microsoft/TypeScript#7639
microsoft/TypeScript#1168

@escardin
Copy link
Contributor

@jostschmithals
Copy link

jostschmithals commented Nov 9, 2016

I had solved the problem by modifying the extension in the source code like this (but I saw this discussion only now):

export class AuthHttpError extends Error {  
  constructor(message) {  
    super(message);  
    this.message = message;  
  }  
}

For me (using typescript 2.0.3) this simple solution works in all browsers.

@chenkie chenkie closed this May 8, 2018
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

Successfully merging this pull request may close these issues.

4 participants