spring boot angular - venta.service.ts:17 Ocurrió un error: HttpErrorResponse {headers: _HttpHeaders, status: 200, statusText: 'OK', url: 'http://localhost:8095/venta/registrarVenta', ok: false, …}
handleError @ venta.service.ts:17
(anonymous) @ catchError.js:10
OperatorSubscriber2._this._error @ OperatorSubscriber.js:25
Subscriber2.error @ Subscriber.js:43
Subscriber2._error @ Subscriber.js:67
Subscriber2.error @ Subscriber.js:43
Subscriber2._error @ Subscriber.js:67
Subscriber2.error @ Subscriber.js:43
Subscriber2._error @ Subscriber.js:67
Subscriber2.error @ Subscriber.js:43
Subscriber2._error @ Subscriber.js:67
Subscriber2.error @ Subscriber.js:43
onLoad @ http.mjs:2289
invokeTask @ zone.js:398
(anonymous) @ core.mjs:14556
onInvokeTask @ core.mjs:14556
invokeTask @ zone.js:397
onInvokeTask @ core.mjs:14869
invokeTask @ zone.js:397
runTask @ zone.js:158
invokeTask @ zone.js:479
invokeTask @ zone.js:1109
globalCallback @ zone.js:1152
globalZoneAwareCallback @ zone.js:1173
Zone - XMLHttpRequest.addEventListener:load (async)
onScheduleTask @ core.mjs:14550
scheduleTask @ zone.js:378
onScheduleTask @ zone.js:267
scheduleTask @ zone.js:378
scheduleTask @ zone.js:201
scheduleEventTask @ zone.js:227
(anonymous) @ zone.js:1470
(anonymous) @ http.mjs:2364
Observable2._trySubscribe @ Observable.js:38
(anonymous) @ Observable.js:32
errorContext @ errorContext.js:19
Observable2.subscribe @ Observable.js:23
(anonymous) @ switchMap.js:14
OperatorSubscriber2._this._next @ OperatorSubscriber.js:15
Subscriber2.next @ Subscriber.js:34
(anonymous) @ innerFrom.js:51
Observable2._trySubscribe @ Observable.js:38
(anonymous) @ Observable.js:32
errorContext @ errorContext.js:19
Observable2.subscribe @ Observable.js:23
(anonymous) @ switchMap.js:10
(anonymous) @ lift.js:10
(anonymous) @ Observable.js:27
errorContext @ errorContext.js:19
Observable2.subscribe @ Observable.js:23
(anonymous) @ finalize.js:5
(anonymous) @ lift.js:10
(anonymous) @ Observable.js:27
errorContext @ errorContext.js:19
Observable2.subscribe @ Observable.js:23
(anonymous) @ finalize.js:5
(anonymous) @ lift.js:10
(anonymous) @ Observable.js:27
errorContext @ errorContext.js:19
Observable2.subscribe @ Observable.js:23
doInnerSub @ mergeInternals.js:19
outerNext @ mergeInternals.js:14
OperatorSubscriber2._this._next @ OperatorSubscriber.js:15
Subscriber2.next @ Subscriber.js:34
(anonymous) @ innerFrom.js:51
Observable2._trySubscribe @ Observable.js:38
(anonymous) @ Observable.js:32
errorContext @ errorContext.js:19
Observable2.subscribe @ Observable.js:23
mergeInternals @ mergeInternals.js:53
(anonymous) @ mergeMap.js:14
(anonymous) @ lift.js:10
(anonymous) @ Observable.js:27
errorContext @ errorContext.js:19
Observable2.subscribe @ Observable.js:23
(anonymous) @ filter.js:6
(anonymous) @ lift.js:10
(anonymous) @ Observable.js:27
errorContext @ errorContext.js:19
Observable2.subscribe @ Observable.js:23
(anonymous) @ map.js:6
(anonymous) @ lift.js:10
(anonymous) @ Observable.js:27
errorContext @ errorContext.js:19
Observable2.subscribe @ Observable.js:23
(anonymous) @ catchError.js:9
(anonymous) @ lift.js:10
(anonymous) @ Observable.js:27
errorContext @ errorContext.js:19
Observable2.subscribe @ Observable.js:23
registrarVenta @ nav.component.ts:48
NavComponent_Template_button_click_31_listener @ nav.component.html:76
executeListenerWithErrorHandling @ core.mjs:25638
wrapListenerIn_markDirtyAndPreventDefault @ core.mjs:25672
(anonymous) @ platform-browser.mjs:749
invokeTask @ zone.js:398
(anonymous) @ core.mjs:14556
onInvokeTask @ core.mjs:14556
invokeTask @ zone.js:397
onInvokeTask @ core.mjs:14869
invokeTask @ zone.js:397
runTask @ zone.js:158
invokeTask @ zone.js:479
invokeTask @ zone.js:1109
globalCallback @ zone.js:1140
globalZoneAwareCallback @ zone.js:1173
Zone - HTMLButtonElement.addEventListener:click (async)
onScheduleTask @ core.mjs:14550
scheduleTask @ zone.js:378
onScheduleTask @ zone.js:267
scheduleTask @ zone.js:378
scheduleTask @ zone.js:201
scheduleEventTask @ zone.js:227
(anonymous) @ zone.js:1470
addEventListener @ platform-browser.mjs:850
addEventListener @ platform-browser.mjs:210
listen @ platform-browser.mjs:731
listenerInternal @ core.mjs:25599
ɵɵlistener @ core.mjs:25480
NavComponent_Template @ nav.component.html:76
executeTemplate @ core.mjs:11268
renderView @ core.mjs:12470
renderComponent @ core.mjs:12416
renderChildComponents @ core.mjs:12518
renderView @ core.mjs:12498
createAndRenderEmbeddedLView @ core.mjs:12540
createEmbeddedViewImpl @ core.mjs:13393
createEmbeddedView @ core.mjs:16191
_updateView @ common.mjs:3695
set ngIf @ common.mjs:3669
applyValueToInputField @ core.mjs:4035
writeToDirectiveInput @ core.mjs:11096
setInputsForProperty @ core.mjs:12391
elementPropertyInternal @ core.mjs:11692
ɵɵproperty @ core.mjs:21289
AppComponent_Template @ app.component.html:1
executeTemplate @ core.mjs:11268
refreshView @ core.mjs:12791
detectChangesInView$1 @ core.mjs:13015
detectChangesInViewIfAttached @ core.mjs:12978
detectChangesInComponent @ core.mjs:12967
detectChangesInChildComponents @ core.mjs:13028
refreshView @ core.mjs:12841
detectChangesInView$1 @ core.mjs:13015
detectChangesInViewWhileDirty @ core.mjs:12732
detectChangesInternal @ core.mjs:12714
detectChangesInView @ core.mjs:31734
detectChangesInViewIfRequired @ core.mjs:31707
detectChangesInAttachedViews @ core.mjs:31562
_tick @ core.mjs:31532
tick @ core.mjs:31521
(anonymous) @ core.mjs:31902
invoke @ zone.js:365
onInvoke @ core.mjs:14882
invoke @ zone.js:364
run @ zone.js:111
run @ core.mjs:14733
next @ core.mjs:31901
ConsumerObserver2.next @ Subscriber.js:96
Subscriber2._next @ Subscriber.js:63
Subscriber2.next @ Subscriber.js:34
(anonymous) @ Subject.js:41
errorContext @ errorContext.js:19
Subject2.next @ Subject.js:31
emit @ core.mjs:6845
checkStable @ core.mjs:14801
onHasTask @ core.mjs:14899
hasTask @ zone.js:418
_updateTaskCount @ zone.js:439
_updateTaskCount @ zone.js:260
runTask @ zone.js:175
drainMicroTaskQueue @ zone.js:577
Promise.then (async)
nativeScheduleMicroTask @ zone.js:553
scheduleMicroTask @ zone.js:564
scheduleTask @ zone.js:387
onScheduleTask @ core.mjs:14551
scheduleTask @ zone.js:378
onScheduleTask @ zone.js:267
scheduleTask @ zone.js:378
scheduleTask @ zone.js:201
scheduleMicroTask @ zone.js:221
scheduleResolveOrReject @ zone.js:2488
resolvePromise @ zone.js:2422
(anonymous) @ zone.js:2330
(anonymous) @ zone.js:2346
Promise.then (async)
(anonymous) @ zone.js:2740
ZoneAwarePromise @ zone.js:2662
Ctor.then @ zone.js:2739
loadChildren @ app-routing.module.ts:19
loadChildren @ router.mjs:4311
loadChildren @ router.mjs:4272
(anonymous) @ router.mjs:3927
doInnerSub @ mergeInternals.js:19
outerNext @ mergeInternals.js:14
OperatorSubscriber2._this._next @ OperatorSubscriber.js:15
Subscriber2.next @ Subscriber.js:34
(anonymous) @ innerFrom.js:51
Observable2._trySubscribe @ Observable.js:38
(anonymous) @ Observable.js:32
errorContext @ errorContext.js:19
Observable2.subscribe @ Observable.js:23
mergeInternals @ mergeInternals.js:53
(anonymous) @ mergeMap.js:14
(anonymous) @ lift.js:10
(anonymous) @ Observable.js:27
errorContext @ errorContext.js:19
Observable2.subscribe @ Observable.js:23
(anonymous) @ switchMap.js:10
(anonymous) @ lift.js:10
(anonymous) @ Observable.js:27
errorContext @ errorContext.js:19
Observable2.subscribe @ Observable.js:23
(anonymous) @ switchMap.js:14
OperatorSubscriber2._this._next @ OperatorSubscriber.js:15
Subscriber2.next @ Subscriber.js:34
(anonymous) @ map.js:7
OperatorSubscriber2._this._next @ OperatorSubscriber.js:15
Subscriber2.next @ Subscriber.js:34
(anonymous) @ map.js:7
OperatorSubscriber2._this._next @ OperatorSubscriber.js:15
Subscriber2.next @ Subscriber.js:34
(anonymous) @ tap.js:18
OperatorSubscriber2._this._next @ OperatorSubscriber.js:15
Subscriber2.next @ Subscriber.js:34
(anonymous) @ switchMap.js:14
OperatorSubscriber2._this._next @ OperatorSubscriber.js:15
Subscriber2.next @ Subscriber.js:34
(anonymous) @ take.js:12
OperatorSubscriber2._this._next @ OperatorSubscriber.js:15
Subscriber2.next @ Subscriber.js:34
(anonymous) @ filter.js:6
OperatorSubscriber2._this._next @ OperatorSubscriber.js:15
Subscriber2.next @ Subscriber.js:34
(anonymous) @ map.js:7
OperatorSubscriber2._this._next @ OperatorSubscriber.js:15
Subscriber2.next @ Subscriber.js:34
(anonymous) @ combineLatest.js:47
OperatorSubscriber2._this._next @ OperatorSubscriber.js:15
Subscriber2.next @ Subscriber.js:34
(anonymous) @ mergeInternals.js:25
OperatorSubscriber2._this._next @ OperatorSubscriber.js:15
Subscriber2.next @ Subscriber.js:34
(anonymous) @ take.js:12
OperatorSubscriber2._this._next @ OperatorSubscriber.js:15
Subscriber2.next @ Subscriber.js:34
(anonymous) @ innerFrom.js:51
Observable2._trySubscribe @ Observable.js:38
(anonymous) @ Observable.js:32
errorContext @ errorContext.js:19
Observable2.subscribe @ Observable.js:23
(anonymous) @ take.js:10
(anonymous) @ lift.js:10
(anonymous) @ Observable.js:27
errorContext @ errorContext.js:19
Observable2.subscribe @ Observable.js:23
doInnerSub @ mergeInternals.js:19
outerNext @ mergeInternals.js:14
OperatorSubscriber2._this._next @ OperatorSubscriber.js:15
Subscriber2.next @ Subscriber.js:34
(anonymous) @ innerFrom.js:51
Observable2._trySubscribe @ Observable.js:38
(anonymous) @ Observable.js:32
errorContext @ errorContext.js:19
Observable2.subscribe @ Observable.js:23
mergeInternals @ mergeInternals.js:53
(anonymous) @ mergeMap.js:14
(anonymous) @ lift.js:10
(anonymous) @ Observable.js:27
errorContext @ errorContext.js:19
Observable2.subscribe @ Observable.js:23
(anonymous) @ startWith.js:11
(anonymous) @ lift.js:10
(anonymous) @ Observable.js:27
errorContext @ errorContext.js:19
Observable2.subscribe @ Observable.js:23
(anonymous) @ combineLatest.js:40
maybeSchedule @ combineLatest.js:67
_loop_1 @ combineLatest.js:37
(anonymous) @ combineLatest.js:57
maybeSchedule @ combineLatest.js:67
(anonymous) @ combineLatest.js:31
Observable2._trySubscribe @ Observable.js:38
(anonymous) @ Observable.js:32
errorContext @ errorContext.js:19
Observable2.subscribe @ Observable.js:23
(anonymous) @ map.js:6
(anonymous) @ lift.js:10
(anonymous) @ Observable.js:27
errorContext @ errorContext.js:19
Observable2.subscribe @ Observable.js:23
(anonymous) @ filter.js:6
(anonymous) @ lift.js:10
(anonymous) @ Observable.js:27
errorContext @ errorContext.js:19
Observable2.subscribe @ Observable.js:23
(anonymous) @ take.js:10
(anonymous) @ lift.js:10
(anonymous) @ Observable.js:27
errorContext @ errorContext.js:19
Observable2.subscribe @ Observable.js:23
(anonymous) @ switchMap.js:14
OperatorSubscriber2._this._next @ OperatorSubscriber.js:15
Subscriber2.next @ Subscriber.js:34
(anonymous) @ innerFrom.js:51
Observable2._trySubscribe @ Observable.js:38
(anonymous) @ Observable.js:32
errorContext @ errorContext.js:19
Observable2.subscribe @ Observable.js:23
(anonymous) @ switchMap.js:10
(anonymous) @ lift.js:10
(anonymous) @ Observable.js:27
errorContext @ errorContext.js:19
Observable2.subscribe @ Observable.js:23
(anonymous) @ tap.js:15
(anonymous) @ lift.js:10
(anonymous) @ Observable.js:27
errorContext @ errorContext.js:19
Observable2.subscribe @ Observable.js:23
(anonymous) @ map.js:6
(anonymous) @ lift.js:10
(anonymous) @ Observable.js:27
errorContext @ errorContext.js:19
Observable2.subscribe @ Observable.js:23
(anonymous) @ map.js:6
(anonymous) @ lift.js:10
(anonymous) @ Observable.js:27
errorContext @ errorContext.js:19
Observable2.subscribe @ Observable.js:23
(anonymous) @ switchMap.js:10
(anonymous) @ lift.js:10
(anonymous) @ Observable.js:27
errorContext @ errorContext.js:19
Observable2.subscribe @ Observable.js:23
(anonymous) @ catchError.js:9
(anonymous) @ lift.js:10
(anonymous) @ Observable.js:27
errorContext @ errorContext.js:19
Observable2.subscribe @ Observable.js:23
doInnerSub @ mergeInternals.js:19
outerNext @ mergeInternals.js:14
OperatorSubscriber2._this._next @ OperatorSubscriber.js:15
Subscriber2.next @ Subscriber.js:34
(anonymous) @ innerFrom.js:51
Observable2._trySubscribe @ Observable.js:38
(anonymous) @ Observable.js:32
errorContext @ errorContext.js:19
Observable2.subscribe @ Observable.js:23
mergeInternals @ mergeInternals.js:53
(anonymous) @ mergeMap.js:14
(anonymous) @ lift.js:10
(anonymous) @ Observable.js:27
errorContext @ errorContext.js:19
Observable2.subscribe @ Observable.js:23
(anonymous) @ filter.js:6
(anonymous) @ lift.js:10
(anonymous) @ Observable.js:27
errorContext @ errorContext.js:19
Observable2.subscribe @ Observable.js:23
(anonymous) @ take.js:10
(anonymous) @ lift.js:10
(anonymous) @ Observable.js:27
errorContext @ errorContext.js:19
Observable2.subscribe @ Observable.js:23
(anonymous) @ throwIfEmpty.js:8
(anonymous) @ lift.js:10
(anonymous) @ Observable.js:27
errorContext @ errorContext.js:19
Observable2.subscribe @ Observable.js:23
(anonymous) @ catchError.js:9
(anonymous) @ lift.js:10
(anonymous) @ Observable.js:27
errorContext @ errorContext.js:19
Observable2.subscribe @ Observable.js:23
(anonymous) @ map.js:6
(anonymous) @ lift.js:10
(anonymous) @ Observable.js:27
errorContext @ errorContext.js:19
Observable2.subscribe @ Observable.js:23
doInnerSub @ mergeInternals.js:19
outerNext @ mergeInternals.js:14
OperatorSubscriber2._this._next @ OperatorSubscriber.js:15
Subscriber2.next @ Subscriber.js:34
(anonymous) @ innerFrom.js:51
Observable2._trySubscribe @ Observable.js:38
(anonymous) @ Observable.js:32
Zone - Promise.then (async)
onScheduleTask @ core.mjs:14550
scheduleTask @ zone.js:378
onScheduleTask @ zone.js:267
scheduleTask @ zone.js:378
scheduleTask @ zone.js:201
scheduleMicroTask @ zone.js:221
scheduleResolveOrReject @ zone.js:2488
then @ zone.js:2693
(anonymous) @ innerFrom.js:59
Observable2._trySubscribe @ Observable.js:38
(anonymous) @ Observable.js:32
errorContext @ errorContext.js:19
Observable2.subscribe @ Observable.js:23
(anonymous) @ switchMap.js:14
OperatorSubscriber2._this._next @ OperatorSubscriber.js:15
Subscriber2.next @ Subscriber.js:34
(anonymous) @ innerFrom.js:51
Observable2._trySubscribe @ Observable.js:38
(anonymous) @ Observable.js:32
errorContext @ errorContext.js:19
Observable2.subscribe @ Observable.js:23
(anonymous) @ switchMap.js:10
(anonymous) @ lift.js:10
(anonymous) @ Observable.js:27
errorContext @ errorContext.js:19
Observable2.subscribe @ Observable.js:23
mergeInternals @ mergeInternals.js:53
(anonymous) @ mergeMap.js:14
(anonymous) @ lift.js:10
(anonymous) @ Observable.js:27
errorContext @ errorContext.js:19
Observable2.subscribe @ Observable.js:23
(anonymous) @ tap.js:15
(anonymous) @ lift.js:10
(anonymous) @ Observable.js:27
errorContext @ errorContext.js:19
Observable2.subscribe @ Observable.js:23
(anonymous) @ switchMap.js:14
OperatorSubscriber2._this._next @ OperatorSubscriber.js:15
Subscriber2.next @ Subscriber.js:34
(anonymous) @ innerFrom.js:51
Observable2._trySubscribe @ Observable.js:38
(anonymous) @ Observable.js:32
errorContext @ errorContext.js:19
Observable2.subscribe @ Observable.js:23
(anonymous) @ switchMap.js:10
(anonymous) @ lift.js:10
(anonymous) @ Observable.js:27
errorContext @ errorContext.js:19
Observable2.subscribe @ Observable.js:23
(anonymous) @ tap.js:15
(anonymous) @ lift.js:10
(anonymous) @ Observable.js:27
errorContext @ errorContext.js:19
Observable2.subscribe @ Observable.js:23
(anonymous) @ map.js:6
(anonymous) @ lift.js:10
(anonymous) @ Observable.js:27
errorContext @ errorContext.js:19
Observable2.subscribe @ Observable.js:23
mergeInternals @ mergeInternals.js:53
(anonymous) @ mergeMap.js:14
(anonymous) @ lift.js:10
(anonymous) @ Observable.js:27
errorContext @ errorContext.js:19
Observable2.subscribe @ Observable.js:23
(anonymous) @ tap.js:15
(anonymous) @ lift.js:10
(anonymous) @ Observable.js:27
errorContext @ errorContext.js:19
Observable2.subscribe @ Observable.js:23
(anonymous) @ filter.js:6
(anonymous) @ lift.js:10
(anonymous) @ Observable.js:27
errorContext @ errorContext.js:19
Observable2.subscribe @ Observable.js:23
(anonymous) @ switchMap.js:10
(anonymous) @ lift.js:10
(anonymous) @ Observable.js:27
errorContext @ errorContext.js:19
Observable2.subscribe @ Observable.js:23
(anonymous) @ switchMap.js:10
(anonymous) @ lift.js:10
(anonymous) @ Observable.js:27
errorContext @ errorContext.js:19
Observable2.subscribe @ Observable.js:23
(anonymous) @ switchMap.js:10
(anonymous) @ lift.js:10
(anonymous) @ Observable.js:27
errorContext @ errorContext.js:19
Observable2.subscribe @ Observable.js:23
(anonymous) @ switchMap.js:10
(anonymous) @ lift.js:10
(anonymous) @ Observable.js:27
errorContext @ errorContext.js:19
Observable2.subscribe @ Observable.js:23
(anonymous) @ map.js:6
(anonymous) @ lift.js:10
(anonymous) @ Observable.js:27
errorContext @ errorContext.js:19
Observable2.subscribe @ Observable.js:23
(anonymous) @ tap.js:15
(anonymous) @ lift.js:10
(anonymous) @ Observable.js:27
errorContext @ errorContext.js:19
Observable2.subscribe @ Observable.js:23
(anonymous) @ map.js:6
(anonymous) @ lift.js:10
(anonymous) @ Observable.js:27
errorContext @ errorContext.js:19
Observable2.subscribe @ Observable.js:23
(anonymous) @ take.js:10
(anonymous) @ lift.js:10
(anonymous) @ Observable.js:27
errorContext @ errorContext.js:19
Observable2.subscribe @ Observable.js:23
(anonymous) @ tap.js:15
(anonymous) @ lift.js:10
(anonymous) @ Observable.js:27
errorContext @ errorContext.js:19
Observable2.subscribe @ Observable.js:23
(anonymous) @ takeUntil.js:8
(anonymous) @ lift.js:10
(anonymous) @ Observable.js:27
errorContext @ errorContext.js:19
Observable2.subscribe @ Observable.js:23
(anonymous) @ finalize.js:5
(anonymous) @ lift.js:10
(anonymous) @ Observable.js:27
errorContext @ errorContext.js:19
Observable2.subscribe @ Observable.js:23
(anonymous) @ catchError.js:9
(anonymous) @ lift.js:10
(anonymous) @ Observable.js:27
errorContext @ errorContext.js:19
Observable2.subscribe @ Observable.js:23
(anonymous) @ switchMap.js:14
OperatorSubscriber2._this._next @ OperatorSubscriber.js:15
Subscriber2.next @ Subscriber.js:34
(anonymous) @ map.js:7
OperatorSubscriber2._this._next @ OperatorSubscriber.js:15
Subscriber2.next @ Subscriber.js:34
(anonymous) @ filter.js:6
OperatorSubscriber2._this._next @ OperatorSubscriber.js:15
Subscriber2.next @ Subscriber.js:34
(anonymous) @ Subject.js:41
errorContext @ errorContext.js:19
Subject2.next @ Subject.js:31
BehaviorSubject2.next @ BehaviorSubject.js:31
handleNavigationRequest @ router.mjs:4536
scheduleNavigation @ router.mjs:5759
navigateToSyncWithBrowser @ router.mjs:5471
initialNavigation @ router.mjs:5419
(anonymous) @ router.mjs:6906
(anonymous) @ core.mjs:31612
_loadComponent @ core.mjs:31612
bootstrap @ core.mjs:31503
(anonymous) @ core.mjs:32312
_moduleDoBootstrap @ core.mjs:32312
(anonymous) @ core.mjs:32282
invoke @ zone.js:365
onInvoke @ core.mjs:14882
invoke @ zone.js:364
run @ zone.js:111
(anonymous) @ zone.js:2498
invokeTask @ zone.js:398
(anonymous) @ core.mjs:14556
onInvokeTask @ core.mjs:14556
invokeTask @ zone.js:397
onInvokeTask @ core.mjs:14869
invokeTask @ zone.js:397
runTask @ zone.js:158
drainMicroTaskQueue @ zone.js:577
Zone - Promise.then (async)
onScheduleTask @ core.mjs:14550
scheduleTask @ zone.js:378
onScheduleTask @ zone.js:267
scheduleTask @ zone.js:378
scheduleTask @ zone.js:201
scheduleMicroTask @ zone.js:221
scheduleResolveOrReject @ zone.js:2488
then @ zone.js:2693
(anonymous) @ core.mjs:32278
_callAndReportToErrorHandler @ core.mjs:31275
(anonymous) @ core.mjs:32275
invoke @ zone.js:365
onInvoke @ core.mjs:14882
invoke @ zone.js:364
run @ zone.js:111
run @ core.mjs:14733
bootstrapModuleFactory @ core.mjs:32254
(anonymous) @ core.mjs:32307
invoke @ zone.js:365
run @ zone.js:111
(anonymous) @ zone.js:2498
invokeTask @ zone.js:398
runTask @ zone.js:158
drainMicroTaskQueue @ zone.js:577
Promise.then (async)
nativeScheduleMicroTask @ zone.js:553
scheduleMicroTask @ zone.js:564
scheduleTask @ zone.js:387
scheduleTask @ zone.js:201
scheduleMicroTask @ zone.js:221
scheduleResolveOrReject @ zone.js:2488
then @ zone.js:2693
bootstrapModule @ core.mjs:32307
(anonymous) @ main.ts:6
Show 582 more frames
Show less
nav.component.ts:54 Error al registrar la venta Error: Error: 
    at venta.service.ts:18:29
    at Observable2.init [as _subscribe] (throwError.js:5:64)
    at Observable2._trySubscribe (Observable.js:38:25)
    at Observable.js:32:31
    at errorContext (errorContext.js:19:9)
    at Observable2.subscribe (Observable.js:23:9)
    at catchError.js:14:31
    at OperatorSubscriber2._this._error (OperatorSubscriber.js:25:21)
    at Subscriber2.error (Subscriber.js:43:18)
    at Subscriber2._error (Subscriber.js:67:30) -   registrarVentaCarroCompra(): Observable<string>{
    return this.http.post<string>(`${this.apiUrl}/registrarVenta`, null, { withCredentials: true })
    .pipe(catchError(this.handleError));
  }

 -   registrarVenta(): void {
    this.ventaService.registrarVentaCarroCompra().subscribe({
      next: (response: string) => {
        console.log('Venta registrada con éxito', response);
        this.mostrarProductosCarroCompra(); // Opcional, para refrescar el carrito si es necesario
      },
      error: (error) => {
        console.error('Error al registrar la venta', error);
      }
    });
  }
 -     @PostMapping("/registrarVenta")
    public ResponseEntity<String> registrarVenta(@ModelAttribute("dvCarro") List<DetalleVenta> dvCarro) {
        try {
            Cliente cliente = cliService.obtenerClientePorId(1L);
            Usuario usuario = usrService.obtenerUsuarioPorId(1L);

            Venta venta = new Venta();
            venta.setCliente(cliente);
            venta.setUsuario(usuario);
            double sumaTotal = dvCarro.stream().mapToDouble(DetalleVenta::getTotal).sum();
            venta.setSubtotal(sumaTotal);
            vntService.registrar(venta);

            for (DetalleVenta dv : dvCarro) {
                dv.setVenta(venta);
                detService.registrar(dv);

                Inventario inventario = invService.obtenerInventarioProducto(dv.getProducto().getIdproducto());
                invService.actualizarStockVenta(inventario.getIdinventario(), dv.getCantidad());
                movService.registrarMovimientoVenta(inventario.getIdinventario(), dv.getCantidad());
            }

            dvCarro.clear();

            return ResponseEntity.ok("Venta registrada con éxito");
        } catch (AccessDeniedException e) {
            return ResponseEntity.status(HttpStatus.UNAUTHORIZED).body("Acceso denegado");
        } catch (Exception e) {
            return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body("Error al registrar venta");
        }
    } - donde esta el error? solo responde con texto en 5 lineas