Skip to content
This repository has been archived by the owner on Apr 2, 2020. It is now read-only.

Validation #9

Merged
merged 5 commits into from
Feb 12, 2018
Merged

Validation #9

merged 5 commits into from
Feb 12, 2018

Conversation

tomusdrw
Copy link
Contributor

@tomusdrw tomusdrw commented Feb 8, 2018

Supersedes #8

Copy link

@ngotchac ngotchac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One small question/remark, otherwise LGTM

@@ -140,12 +154,9 @@ app.post('/push-build/:tag/:platform', handleAsync(async function (req, res) {
console.log(`Track: ${branch} => ${track} (${tracks[track]}) [enabled: ${!!enabledTracks[track]}]`);

if (!enabledTracks[track]) {
throw new Error(`Track not enabled: ${track}`);
throw boom.accepted(`Track not enabled: ${track}`);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's not an error, right? Why using boom as such? You could just use res to send an early response.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is an error, but I want to return a specific status code in such case. Also I want to separate validation&logic from dealing with req/res directly.

@tomusdrw tomusdrw merged commit 6e63c8c into master Feb 12, 2018
@tomusdrw tomusdrw deleted the td-validation2 branch February 12, 2018 12:27
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants