Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(templates): fix error handling and route method call #83

Merged
merged 2 commits into from
Jul 22, 2024

Conversation

ruidias-commercetools
Copy link
Contributor

@ruidias-commercetools ruidias-commercetools commented Jul 16, 2024

Link to the Jira issue

This PR will englobe two tickets

IM-1114 and IM-1117

Description and context

Since the work was fairly straightforward, we used just one PR to fix both tickets.

So, this PR will close #78 and close #80.

Assessing #78, a new implementation was introduced, as suggested, to call the next() function inside a try-catch block.

serviceRouter.post('/', async (req, res, next) => {
  logger.info('Service post message received');

  try {
    await post(req, res);
    res.status(200).send();
  } catch (error) {
    next(error);
  }
});

Regarding #80, the following files were updated to call the correct controller methods inside the routes.

- application-templates/javascript/event/src/routes/event.route.js
- application-templates/javascript/job/src/routes/job.route.js
- application-templates/javascript/service/src/routes/service.route.js

- application-templates/typescript/event/src/routes/event.route.ts
- application-templates/typescript/job/src/routes/job.route.ts
- application-templates/typescript/service/src/routes/service.route.ts

Type of change

  • Bug fix (non-breaking change which fixes an issue)

@ruidias-commercetools ruidias-commercetools added bug Something isn't working question Further information is requested labels Jul 16, 2024
@ruidias-commercetools ruidias-commercetools self-assigned this Jul 16, 2024
Copy link

changeset-bot bot commented Jul 16, 2024

⚠️ No Changeset found

Latest commit: cfd445a

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

gitstream-cm bot commented Jul 16, 2024

🥷 Code experts: no user matched threshold 10

See details

application-templates/javascript/event/src/routes/event.route.js

Knowledge based on git-blame:

application-templates/javascript/job/src/routes/job.route.js

Knowledge based on git-blame:

application-templates/javascript/service/src/routes/service.route.js

Knowledge based on git-blame:

application-templates/typescript/event/src/routes/event.route.ts

Knowledge based on git-blame:

application-templates/typescript/job/src/routes/job.route.ts

Knowledge based on git-blame:

application-templates/typescript/service/src/routes/service.route.ts

Knowledge based on git-blame:

To learn more about /:\ gitStream - Visit our Docs

@ruidias-commercetools ruidias-commercetools merged commit 5010723 into main Jul 22, 2024
5 checks passed
@ruidias-commercetools ruidias-commercetools deleted the ruidias/IM-1114 branch July 22, 2024 20:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working question Further information is requested
Projects
None yet
3 participants