Skip to content

Commit

Permalink
Display the debug message from the server
Browse files Browse the repository at this point in the history
  • Loading branch information
wrandall22 committed Oct 25, 2023
1 parent a2a4fe4 commit 4c50b40
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,9 @@ class ProductConfigFormController {
if (includes(error.data, 'already in the cart')) {
this.errorAlreadyInCart = true
this.onStateChange({ state: 'errorAlreadyInCart' })
} else if (error?.data?.messages[0]?.id === 'field.invalid.decimal.format') {
this.amountFormatError = error?.data?.messages[0]['debug-message']
this.onStateChange({ state: 'errorSubmitting' })

Check warning on line 344 in src/app/productConfig/productConfigForm/productConfigForm.component.js

View check run for this annotation

Codecov / codecov/patch

src/app/productConfig/productConfigForm/productConfigForm.component.js#L343-L344

Added lines #L343 - L344 were not covered by tests
} else {
this.errorSavingGeneric = true
this.$log.error('Error adding or updating item in cart', error)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ <h4 class="panel-title border-bottom-small" translate>
<p translate>{{'ADDING_CART_ERROR'}}</p>
</div>

<div ng-if="$ctrl.amountFormatError" role="alert" class="alert alert-danger">
<p translate>{{$ctrl.amountFormatError}}</p>
</div>

<div ng-if="$ctrl.errorAlreadyInCart" class="alert alert-warning" role="alert">
<p translate>{{'GIFT_IN_CART_ERROR'}}</p>
</div>
Expand Down

0 comments on commit 4c50b40

Please sign in to comment.