Skip to content

Commit

Permalink
Always print banner before error (#46)
Browse files Browse the repository at this point in the history
This used to only happen in `onlineornot checks delete`
  • Loading branch information
tehtnaz committed Dec 20, 2023
1 parent 9312334 commit 5a37510
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/onlineornot/src/checks/create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ export function options(yargs: CommonYargsArgv) {
export async function handler(
args: StrictYargsOptionsToInterface<typeof options>
) {
await verifyToken();
if (!args.json) {
await printBanner();
}
await verifyToken();
let result: Check;
try {
result = await fetchResult(`/checks/`, {
Expand Down
2 changes: 1 addition & 1 deletion packages/onlineornot/src/checks/individualCheck.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ export function options(yargs: CommonYargsArgv) {
export async function handler(
args: StrictYargsOptionsToInterface<typeof options>
) {
await verifyToken();
if (!args.json) {
await printBanner();
}
await verifyToken();
const result = (await fetchResult(`/checks/${args.id}`)) as Check;

if (args.json) {
Expand Down
2 changes: 1 addition & 1 deletion packages/onlineornot/src/checks/list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ export function options(yargs: CommonYargsArgv) {
export async function handler(
args: StrictYargsOptionsToInterface<typeof options>
) {
await verifyToken();
if (!args.json) {
await printBanner();
}
await verifyToken();
const results = (await fetchPagedResult("/checks")) as Check[];

if (args.json) {
Expand Down

0 comments on commit 5a37510

Please sign in to comment.