-
Notifications
You must be signed in to change notification settings - Fork 1
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
Api #30
Api #30
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
En ehtinyt vielä ihan läpi koluta, mutta alla parit kommentit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Parit kommentit alla. En vieläkään ihan loppuun asti ehtinyt katsoa.
if (!meetupResult.success) { | ||
const validationErrors = formatValidationErrors(meetupResult.error.issues); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Parissa virheenkäsittelyssä turhaa toistoa: parsitaan virheet, päivitetään actionin status, päivitetään issuen kommentti ja ajetaan return
. Sen sijaan voisi wrapata try-catch
:llä koko blockin, ja heittää virheet kun niitä tulee. Lopussa catchillä sitten tehdä nuo käsittelyt.
Tai jos ei try-catch
innosta niin jotain:
void main().catch(error => {
// Update action status
// Update issue comment
// exit
});
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
async function run() {
if(validationError) {
throw new Error('Validation failed');
}
if(anotherError) {
throw new Error('Another error');
}
}
async function main() {
try {
await run();
} catch (error) {
octokit.updateIssueComment(...)
core.setError(...)
}
}
No description provided.