Skip to content

Commit

Permalink
refactor: update error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
therealemjy committed Feb 7, 2025
1 parent 96b0502 commit f38ac8f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ A GitHub Action to ping a website from multiple locations using [Globalping](htt

```yaml
- name: Ping
uses: VenusProtocol/globalping-action
uses: VenusProtocol/globalping-action@main
with:
target: venus.io
countryCodes: |
Expand Down
6 changes: 4 additions & 2 deletions src/main.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import axios, { AxiosError } from 'axios';
import axios from 'axios';
import { getInput, getMultilineInput, setFailed } from '@actions/core';
import { context } from '@actions/github';

Expand Down Expand Up @@ -27,7 +27,9 @@ const run = async () => {

console.log('Target successfully pinged:\n', output.data);
} catch (error) {
setFailed(error as AxiosError);
setFailed('Failed to ping target');
console.log(error);
return;
}
};

Expand Down

0 comments on commit f38ac8f

Please sign in to comment.