This code is making a call to Jasper server to establish a connection using SAML authentication. When the code is executed it jumps to handleError routine, although it is 200 but still having a parsing error. *Here is the console info when the code is executed*
On Sunday, May 5, 2019 at 6:48:40 PM UTC-4, Knight wrote: > > > <p> > <i> > <code> > DOM7011: The code on this page disabled back and forward caching. For more > information, see: http://go.microsoft.com/fwlink/?LinkID=291337 > report > HTML1300: Navigation occurred. > report > In Report Component init > In connectToJasperconnected > [object Object] > { > [functions]: , > __proto__: { }, > error: { }, > headers: { }, > message: "Http failure during parsing for THE URL", > name: "HttpErrorResponse", > ok: false, > status: 200, > statusText: "OK", > Symbol(INITIAL_VALUE)_h.bdyrahld8ry: undefined, > Symbol(rxSubscriber)_g.bdyrahld8ry: undefined, > Symbol(rxSubscriber)_i.bdyrahld8ry: undefined, > url: "THE URL" > } > > > > Server Error Status: 200 <-- coming from the error routine > Error Connecting to Jasper Server: [object Object] <-- coming from the > error routine defined in component > > </i> > > <b>Component code</b> > > ngOnInit(): void { > console.log('In Report Component init'); > this.connectToJasper(); > } > > connectToJasper() { > this.samlConnectionService. > getSAMLConnection(). > subscribe( > data => this.connected = true, > error => console.log('Error Connecting to Jasper Server: ' + error) > ); > console.log('In connectToJasperconnected'); > } > > <b>Service code</b> > > jasperSamlURL = 'THE URL'; > > getSAMLConnection(): Observable<any> { > // return this.httpClient.get<any>(this.jasperSamlURL, { responseType: > 'text'}) > // return this.httpClient.post<any>(this.jasperSamlURL, { observe: > 'response'}) > return this.httpClient.get(this.jasperSamlURL, { observe: 'response', > responseType: 'text' }) > .pipe( > tap(response => { > console.log('Http Response Status: ' + response.status); > console.log('Http Response text: ' + response.statusText); > console.log('Http Response Type: ' + response.type); > console.log('Http Response Body: ' + response.body); > }), > map(response => this.HttpResponseCode = response.status), > catchError(this.handleError) > ); > } > > public handleError(err) { > if (err instanceof HttpErrorResponse) { > // Server side Error > this.HttpResponseCode = err.status; > console.log(err); > console.log('Server Error Status: ' + err.status); > } else { > // Client side error > this.HttpResponseCode = err.status; > console.log('Client Error Status: ' + err.status); > } > return throwError(err); > } > </code> > > -- You received this message because you are subscribed to the Google Groups "Angular and AngularJS discussion" group. To unsubscribe from this group and stop receiving emails from it, send an email to angular+unsubscr...@googlegroups.com. To post to this group, send email to angular@googlegroups.com. Visit this group at https://groups.google.com/group/angular. For more options, visit https://groups.google.com/d/optout.