Skip to content

Commit

Permalink
Update the documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
cedx committed Jan 29, 2024
1 parent be75beb commit df6f2ce
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
3 changes: 2 additions & 1 deletion docs/usage/check_comment.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ try {
console.log(result == CheckResult.ham ? "The comment is ham." : "The comment is spam.");
}
catch (error) {
console.log(`An error occurred: ${error}`);
const message = error instanceof Error ? error.message : String(error);
console.log(`An error occurred: ${message}`);
}
```

Expand Down
3 changes: 2 additions & 1 deletion docs/usage/submit_ham.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ try {
console.log("The comment was successfully submitted as ham.");
}
catch (error) {
console.log(`An error occurred: ${error}`);
const message = error instanceof Error ? error.message : String(error);
console.log(`An error occurred: ${message}`);
}
```
3 changes: 2 additions & 1 deletion docs/usage/submit_spam.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ try {
console.log("The comment was successfully submitted as spam.");
}
catch (error) {
console.log(`An error occurred: ${error}`);
const message = error instanceof Error ? error.message : String(error);
console.log(`An error occurred: ${message}`);
}
```
3 changes: 2 additions & 1 deletion docs/usage/verify_key.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ try {
console.log(isValid ? "The API key is valid." : "The API key is invalid.");
}
catch (error) {
console.log(`An error occurred: ${error}`);
const message = error instanceof Error ? error.message : String(error);
console.log(`An error occurred: ${message}`);
}
```

Expand Down

0 comments on commit df6f2ce

Please sign in to comment.