MCPcopy Create free account
hub / github.com/github/gh-aw / isLockedError

Function isLockedError

actions/setup/js/error_helpers.cjs:54–67  ·  view source on GitHub ↗

* Check if an error is due to a locked issue/PR/discussion. * GitHub API returns 403 with specific messages for locked resources. * This helper is used to determine if an operation should be silently ignored. * * @param {unknown} error - The error value to check * @returns {boolean} True if err

(error)

Source from the content-addressed store, hash-verified

52 * @returns {boolean} True if error is due to locked resource, false otherwise
53 */
54function isLockedError(error) {
55 // Check if the error has a 403 status code
56 const is403Error = error && typeof error === "object" && "status" in error && error.status === 403;
57 if (!is403Error) {
58 return false;
59 }
60
61 // Check if the error message mentions "locked"
62 const errorMessage = getErrorMessage(error);
63 const hasLockedMessage = Boolean(errorMessage && (errorMessage.includes("locked") || errorMessage.includes("Lock conversation")));
64
65 // Only return true if it's BOTH a 403 status code AND mentions locked
66 return hasLockedMessage;
67}
68
69/**
70 * Check if an error is due to a GitHub API rate limit being exceeded.

Callers 4

mainFunction · 0.85
handleReactionErrorFunction · 0.85
mainFunction · 0.85

Calls 1

getErrorMessageFunction · 0.70

Tested by

no test coverage detected