Questions tagged error-handling

Explore the latest questions and answers asked by our top developers.

A propriedade ‘functions’ não existe no tipo ‘typeof import("c:/Users/Gabriel/Desktop/FollowlikeV8-master/client/node_mod [closed]

Estou tentando utilizar o Gateway do mercado Pago utilizando o fireblaze pois de outra forma não aparece o botão para pagamento no Angular12. Este é o erro, desde já, agradeço: index.js (Firebase) enter image description here mercadopago.js (firebase) enter image description here mercadopago-button.ts enter image description here checkout.service.ts enter image description here error Erro está […]

functions() property does not exist in typeof import(c:/Users/Gabriel/Desktop/FollowlikeV8-master/client/node_mod [closed]

I am trying to use the Paid Market Gateway using fireblaze because otherwise the payment button does not appear in Angular12. This is the error, thank you in advance: index.js (Firebase) Code mercadopago.js (firebase) Code mercadopago-button.ts Code checkout.service.ts Code error Erro is here checkout.service.ts Source: Angular Questions

How to JUnit test HttpErrorInterceptor in angular-jasmine

I want to JUnit test my Interceptor, I developed two different way and both are passing but none of them got reach the catchError that is the part that I want really test. How can I really test that the interceptor throw the error message that I expect.Why the test is passing when is not […]

Passing a function to catchError

I defined a simple function that will open a MatSnackBar and display the error message when a get request returns any error handleError(err: HttpErrorResponse) { return throwError(err) } So when I subscribe to an observable in the constructor I pass the above function to catchError constructor(private snackBack: MatSnackBar) { … this._obv$ = this.myService.getTypes().pipe( catchError(this.handleError) […]

By Antonio Santoro
Categorized as angular, error-handling, rxjs, typescript Tagged , , ,

Angular 12 global exception handling

I would like to implement global exception handler in my Angular app, which will handle only exceptions unhandled on service level. I think this is quite common scenario, because good UX/UI should display specific error description as first. Otherwise (if not handled on service level) it should fall back to some generic error description. Currently […]

By sider
Categorized as angular, error-handling, interceptor Tagged , ,

Problem with connexion to webSocket when it’s called multiple times successively

i’m working with websocket springBoot in the backend and angular in the front end and i’m using SockJS, and i need to call tree different calls of connexion to websocket in the frontEnd i have a problem with the function to connect, actually i was using this one public async initWebSocket() { return new Promise<void>((resolve,reject) […]

How do I throw an error in a component and handle it in ErrorHandler?

There is my interceptor class, it should check if an error status is 401 and if it is it calls signOut() method from a service, if it isn’t does nothing: @Injectable() export class MyErrorHandler implements ErrorHandler { constructor( private UserService: UserService, ) { } handleError(error) { if (error?.status === 401) { this.UserService.signOut(); } } } […]

parse angular error object, utilizing only the ‘title’ property for ssr

I created a form with angular 11 client and net core 5.0 server-side. The form is complete with the exception of rendering an exception via the client when a 500 error, how do I incorporate verbiage to render on the client when a 500 status code is returned if using the error object’s title property […]

Angular 12 with ERROR TypeError: this.handleError is not a function

I am developing a web APP using Angular 12. I used a global error handler to process all my http errors. In my book portal component (in book module), When I called ReaderService function (getFavorList) from another reader module, got an error: TypeError: this.handleError is not a function. If I call this function in same […]

By Michael
Categorized as angular, error-handling, javascript, this Tagged , , ,

Getting the error message from BadRequest

I’m trying to get my Sign up form to display the errors coming back from API when a user sends invalid data. You can see here how the error response looks in the console: console ss This is what i tried to do in RegisterComponent.ts: onSubmit() { this.userService.register(this.registerForm.value).subscribe(response =>{ this.router.navigateByUrl(‘/shop’); }, error => { console.log(error); […]

By pu igreen
Categorized as angular, error-handling, typescript Tagged , ,
1 2 3 9

Still Have Questions?

Our dedicated development team is here for you!

We can help you find answers to your question for as low as 5$.

Contact Us