MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / internal_error

Function internal_error

src/jrd/err.cpp:417–456  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

415
416
417static void internal_error(ISC_STATUS status, int number, const TEXT* file, int line)
418{
419/**************************************
420 *
421 * i n t e r n a l _ e r r o r
422 *
423 **************************************
424 *
425 * Functional description
426 * Things seem to be going poorly today.
427 *
428 **************************************/
429 TEXT errmsg[MAX_ERRMSG_LEN + 1];
430
431 if (gds__msg_lookup(0, FB_IMPL_MSG_FACILITY_JRD_BUGCHK, number, sizeof(errmsg), errmsg, NULL) < 1)
432 strcpy(errmsg, "Internal error code");
433
434 const size_t len = strlen(errmsg);
435
436 if (file)
437 {
438 // Remove path information
439 const TEXT* ptr = file + strlen(file);
440 for (; ptr > file; ptr--)
441 {
442 if ((*ptr == '/') || (*ptr == '\\'))
443 {
444 ptr++;
445 break;
446 }
447 }
448 fb_utils::snprintf(errmsg + len, sizeof(errmsg) - len,
449 " (%d), file: %s line: %d", number, ptr, line);
450 }
451 else {
452 fb_utils::snprintf(errmsg + len, sizeof(errmsg) - len, " (%d)", number);
453 }
454
455 ERR_post(Arg::Gds(status) << Arg::Str(errmsg));
456}

Callers 3

ERR_bugcheckFunction · 0.70
ERR_soft_bugcheckFunction · 0.70
ERR_corruptFunction · 0.70

Calls 4

GdsClass · 0.85
StrClass · 0.85
ERR_postFunction · 0.70
snprintfFunction · 0.50

Tested by

no test coverage detected