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

Api #30

Merged
merged 53 commits into from
Aug 29, 2023
Merged

Api #30

merged 53 commits into from
Aug 29, 2023

Conversation

veeti-k
Copy link
Collaborator

@veeti-k veeti-k commented Aug 20, 2023

No description provided.

Copy link
Contributor

@AriPerkkio AriPerkkio left a 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.

.github/ISSUE_TEMPLATE/new-meetup.yml Outdated Show resolved Hide resolved
.github/workflows/new-meetup.yml Show resolved Hide resolved
.github/workflows/new-meetup.yml Outdated Show resolved Hide resolved
packages/actions-new-meetup/src/index.ts Outdated Show resolved Hide resolved
packages/api/src/workerCreateIssue.ts Outdated Show resolved Hide resolved
Copy link
Contributor

@AriPerkkio AriPerkkio left a 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.

packages/meetup-shared/src/meetupIssueCommentStatus.ts Outdated Show resolved Hide resolved
packages/meetup-shared/src/meetupIssueCommentStatus.ts Outdated Show resolved Hide resolved
packages/meetup-shared/src/meetupIssueCommentStatus.ts Outdated Show resolved Hide resolved
Comment on lines 69 to 70
if (!meetupResult.success) {
const validationErrors = formatValidationErrors(meetupResult.error.issues);
Copy link
Contributor

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
});

Copy link
Contributor

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(...)
  }
}

@AriPerkkio AriPerkkio merged commit dd41c3d into PlanBee-dev:master Aug 29, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants