fix: resolve vscode type errors in API endpoints files (#4555)

Co-authored-by: Alexandr <qwerty541zxc@gmail.com>
This commit is contained in:
Ophelia Goldstein
2025-10-25 18:27:41 +02:00
committed by martin-mfg
co-authored by Alexandr
parent 0cdf899b6f
commit 1ac197ceae
5 changed files with 87 additions and 8 deletions
+15
View File
@@ -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,
};