Do not use abort() in frontend code (#131)

* Do not use abort() in frontend code

* Do not abort() on known but erroneous statuses
This commit is contained in:
Andrey Borodin 2020-03-10 15:22:26 +05:00 committed by GitHub
parent b7bcb86956
commit 1b6f168c3d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 4 deletions

View File

@ -879,10 +879,18 @@ od_frontend_cleanup(od_client_t *client, char *context,
/* close backend connection */
od_router_close(router, client);
break;
default:
abort();
break;
case OD_UNDEF:
case OD_SKIP:
case OD_ATTACH:
case OD_DETACH:
od_error(&instance->logger, context, client, server,
"%s", "unexpected error status %s (%d)", od_status_to_str(status), (uint32)status);
od_router_close(router, client);
break;
default:
od_error(&instance->logger, context, client, server,
"%s", "unexpected error status %s (%d), possible corruption, abort()", od_status_to_str(status), (uint32)status);
abort();
}
}