Skip to content

Commit

Permalink
fix(core): Improve error message for missing price data
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelbromley committed Jan 22, 2021
1 parent 04a4c39 commit 634e14b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/core/src/i18n/messages/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"forbidden": "You are not currently authorized to perform this action",
"invalid-sort-field": "The sort field '{ fieldName }' is invalid. Valid fields are: { validFields }",
"no-active-tax-zone": "The active tax zone could not be determined. Ensure a default tax zone is set for the current channel.",
"no-price-found-for-channel": "No price information was found for ProductVariant ID '{ variantId}' in the Channel '{ channel }'.",
"no-search-plugin-configured": "No search plugin has been configured",
"order-does-not-contain-line-with-id": "This order does not contain an OrderLine with the id { id }",
"pending-identifier-missing": "Could not find the pending email address to update",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,10 @@ export class ProductVariantService {
applyChannelPriceAndTax(variant: ProductVariant, ctx: RequestContext): ProductVariant {
const channelPrice = variant.productVariantPrices.find(p => idsAreEqual(p.channelId, ctx.channelId));
if (!channelPrice) {
throw new InternalServerError(`error.no-price-found-for-channel`);
throw new InternalServerError(`error.no-price-found-for-channel`, {
variantId: variant.id,
channel: ctx.channel.code,
});
}
const { taxZoneStrategy } = this.configService.taxOptions;
const zones = this.zoneService.findAll(ctx);
Expand Down

0 comments on commit 634e14b

Please sign in to comment.