MCPcopy Index your code
hub / github.com/di-sukharev/opencommit / extractErrorMessage

Function extractErrorMessage

out/cli.cjs:74668–74694  ·  view source on GitHub ↗
(error)

Source from the content-addressed store, hash-verified

74666 const seconds = parseInt(retryAfter, 10);
74667 if (!isNaN(seconds)) {
74668 return seconds;
74669 }
74670 }
74671 }
74672 return void 0;
74673}
74674function extractErrorMessage(error) {
74675 if (error instanceof Error) {
74676 return error.message;
74677 }
74678 const apiError = error?.response?.data?.error;
74679 if (apiError) {
74680 if (typeof apiError === "string") {
74681 return apiError;
74682 }
74683 if (apiError.message) {
74684 return apiError.message;
74685 }
74686 }
74687 const errorData = error?.error;
74688 if (errorData) {
74689 if (typeof errorData === "string") {
74690 return errorData;
74691 }
74692 if (errorData.message) {
74693 return errorData.message;
74694 }
74695 }
74696 if (typeof error === "string") {
74697 return error;

Callers 1

normalizeEngineErrorFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…