fix: resolve vscode type errors in API endpoints files (#4555)
Co-authored-by: Alexandr <qwerty541zxc@gmail.com>
This commit is contained in:
committed by
martin-mfg
co-authored by
Alexandr
parent
0cdf899b6f
commit
1ac197ceae
@@ -1,3 +1,5 @@
|
||||
// @ts-check
|
||||
|
||||
import { OWNER_AFFILIATIONS } from "./utils.js";
|
||||
|
||||
/**
|
||||
@@ -67,9 +69,22 @@ class MissingParamError extends Error {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve secondary message from an error object.
|
||||
*
|
||||
* @param {Error} err The error object.
|
||||
* @returns {string|undefined} The secondary message if available, otherwise undefined.
|
||||
*/
|
||||
const retrieveSecondaryMessage = (err) => {
|
||||
return "secondaryMessage" in err && typeof err.secondaryMessage === "string"
|
||||
? err.secondaryMessage
|
||||
: undefined;
|
||||
};
|
||||
|
||||
export {
|
||||
CustomError,
|
||||
MissingParamError,
|
||||
SECONDARY_ERROR_MESSAGES,
|
||||
TRY_AGAIN_LATER,
|
||||
retrieveSecondaryMessage,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user