Skip to content

Commit

Permalink
feat(google-cloud-tasks): cahngelog and package version
Browse files Browse the repository at this point in the history
  • Loading branch information
martijnvdbrug committed Sep 26, 2023
1 parent 78a5129 commit d1c2d57
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion packages/vendure-plugin-google-cloud-tasks/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# 1.1.2 (2023-09-26)

- Added custom error handler to inspect errors from failed jobs([#262](https://github.com/Pinelab-studio/pinelab-vendure-plugins/pull/262))
- Added `onJobFailure` option to inspect errors from failed jobs([#262](https://github.com/Pinelab-studio/pinelab-vendure-plugins/pull/262))
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,12 @@ export class CloudTasksHandler implements OnApplicationBootstrap {
res.sendStatus(200);
return;
} catch (error: any) {
if (CloudTasksPlugin.options.errorHandler) {
if (CloudTasksPlugin.options.onJobFailure) {
try {
await CloudTasksPlugin.options.errorHandler(error);
await CloudTasksPlugin.options.onJobFailure(error);
} catch (e: any) {
Logger.error(
`Error in 'errorHandler': ${e}`,
`Error in 'onJobFailure': ${e}`,
CloudTasksPlugin.loggerCtx
);
}
Expand Down
2 changes: 1 addition & 1 deletion packages/vendure-plugin-google-cloud-tasks/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export interface CloudTaskOptions {
* Custom error handler for when a job fails.
* Useful for when you'd like to inspect specific errors in your project.
*/
errorHandler?: (error: any) => void | Promise<void>;
onJobFailure?: (error: any) => void | Promise<void>;
/**
* Optional suffix, I.E. for differentiating between test, acc and prod queues
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ describe('CloudTasks job queue e2e', () => {
authSecret: 'some-secret',
queueSuffix: 'plugin-test',
defaultJobRetries: 50,
errorHandler: async (error) => {
onJobFailed: async (error) => {
console.log('Custom error handler', error);
},
})
Expand Down

0 comments on commit d1c2d57

Please sign in to comment.