| 415 | |
| 416 | |
| 417 | static 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 | } |
no test coverage detected