enhance: provide more details to command delete error
This commit is contained in:
parent
03036c8b77
commit
d206d7a77c
8 changed files with 38 additions and 8 deletions
|
@ -60,7 +60,10 @@ export default abstract class AwardCommandHandler {
|
||||||
.execute()
|
.execute()
|
||||||
.then(() => {})
|
.then(() => {})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
throw new InternalException("Failed deleting award", err);
|
throw new InternalException(
|
||||||
|
`Failed deleting award ${err.code.includes("ER_ROW_IS_REFERENCED") ? " due to referenced data" : ""}`,
|
||||||
|
err
|
||||||
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -66,7 +66,10 @@ export default abstract class CalendarTypeCommandHandler {
|
||||||
.execute()
|
.execute()
|
||||||
.then(() => {})
|
.then(() => {})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
throw new InternalException("Failed deleting calendarType", err);
|
throw new InternalException(
|
||||||
|
`Failed deleting calendarType${err.code.includes("ER_ROW_IS_REFERENCED") ? " due to referenced data" : ""}`,
|
||||||
|
err
|
||||||
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -66,7 +66,12 @@ export default abstract class CommunicationTypeCommandHandler {
|
||||||
.execute()
|
.execute()
|
||||||
.then(() => {})
|
.then(() => {})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
throw new InternalException("Failed deleting communicationType", err);
|
throw new InternalException(
|
||||||
|
`Failed deleting communicationType${
|
||||||
|
err.code.includes("ER_ROW_IS_REFERENCED") ? " due to referenced data" : ""
|
||||||
|
}`,
|
||||||
|
err
|
||||||
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -64,7 +64,12 @@ export default abstract class ExecutivePositionCommandHandler {
|
||||||
.execute()
|
.execute()
|
||||||
.then(() => {})
|
.then(() => {})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
throw new InternalException("Failed deleting executivePosition", err);
|
throw new InternalException(
|
||||||
|
`Failed deleting executivePosition${
|
||||||
|
err.code.includes("ER_ROW_IS_REFERENCED") ? " due to referenced data" : ""
|
||||||
|
}`,
|
||||||
|
err
|
||||||
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -64,7 +64,12 @@ export default abstract class MembershipStatusCommandHandler {
|
||||||
.execute()
|
.execute()
|
||||||
.then(() => {})
|
.then(() => {})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
throw new InternalException("Failed deleting membershipStatus", err);
|
throw new InternalException(
|
||||||
|
`Failed deleting membershipStatus${
|
||||||
|
err.code.includes("ER_ROW_IS_REFERENCED") ? " due to referenced data" : ""
|
||||||
|
}`,
|
||||||
|
err
|
||||||
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -66,7 +66,10 @@ export default abstract class QualificationCommandHandler {
|
||||||
.execute()
|
.execute()
|
||||||
.then(() => {})
|
.then(() => {})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
throw new InternalException("Failed deleting qualification", err);
|
throw new InternalException(
|
||||||
|
`Failed deleting qualification${err.code.includes("ER_ROW_IS_REFERENCED") ? " due to referenced data" : ""}`,
|
||||||
|
err
|
||||||
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -63,7 +63,10 @@ export default abstract class QueryStoreCommandHandler {
|
||||||
.execute()
|
.execute()
|
||||||
.then(() => {})
|
.then(() => {})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
throw new InternalException("Failed deleting queryStore", err);
|
throw new InternalException(
|
||||||
|
`Failed deleting queryStore${err.code.includes("ER_ROW_IS_REFERENCED") ? " due to referenced data" : ""}`,
|
||||||
|
err
|
||||||
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -64,7 +64,10 @@ export default abstract class TemplateCommandHandler {
|
||||||
.execute()
|
.execute()
|
||||||
.then(() => {})
|
.then(() => {})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
throw new InternalException("Failed deleting template", err);
|
throw new InternalException(
|
||||||
|
`Failed deleting template${err.code.includes("ER_ROW_IS_REFERENCED") ? " due to referenced data" : ""}`,
|
||||||
|
err
|
||||||
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue