File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ import { isObject } from "./object";
5
5
6
6
/**
7
7
* Typeguard for an error object shape (has name and message)
8
- * @param e Something caught by a catch clause.
8
+ * @param e - Something caught by a catch clause.
9
9
*/
10
10
export function isError ( e : unknown ) : e is Error {
11
11
if ( isObject ( e ) ) {
@@ -19,7 +19,7 @@ export function isError(e: unknown): e is Error {
19
19
/**
20
20
* Given what is thought to be an error object, return the message if possible.
21
21
* If the message is missing, returns a stringified version of the input.
22
- * @param e Something thrown from a try{} block
22
+ * @param e - Something thrown from a try block
23
23
* @returns The error message or a string of the input
24
24
*/
25
25
export function getErrorMessage ( e : unknown ) : string {
@@ -33,7 +33,7 @@ export function getErrorMessage(e: unknown): string {
33
33
} else {
34
34
stringified = String ( e ) ;
35
35
}
36
- } catch ( e ) {
36
+ } catch ( err ) {
37
37
stringified = "[unable to stringify input]" ;
38
38
}
39
39
return `Unknown error ${ stringified } ` ;
Original file line number Diff line number Diff line change
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT license.
3
+
1
4
/**
2
5
* Returns a random integer value between a lower and upper bound,
3
6
* inclusive of both bounds.
You can’t perform that action at this time.
0 commit comments