feat: Normalize known DB errors to a MedusaError when possible (#6922)
Before we would swallow the error and return a generic error to the user. This will provide more information to the caller if it is one of the known errors.
This commit is contained in:
@@ -83,7 +83,7 @@ medusaIntegrationTestRunner({
|
||||
})
|
||||
})
|
||||
|
||||
it("should throw error when shipping option does not exist", async () => {
|
||||
it.only("should throw error when shipping option does not exist", async () => {
|
||||
const { response } = await api
|
||||
.post(
|
||||
`/admin/fulfillment/shipping-options/does-not-exist/rules/batch/add`,
|
||||
@@ -100,7 +100,7 @@ medusaIntegrationTestRunner({
|
||||
expect(response.data).toEqual({
|
||||
type: "not_found",
|
||||
message:
|
||||
"Shipping_option with shipping_option_id does-not-exist does not exist.",
|
||||
"You tried to set relationship shipping_option_id: does-not-exist, but such entity does not exist",
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user