0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-17 23:40:57 +01:00

ircd::db: Add schema_error exception; use for bad column names.

This commit is contained in:
Jason Volk 2017-08-19 15:31:46 -06:00
parent 8acd5f5ec9
commit 9bbe7b8b4d
2 changed files with 3 additions and 2 deletions

View file

@ -41,6 +41,7 @@ struct database;
//
IRCD_EXCEPTION(ircd::error, error)
IRCD_EXCEPTION(error, not_found)
IRCD_EXCEPTION(error, schema_error)
IRCD_EXCEPTION_HIDENAME(error, corruption)
IRCD_EXCEPTION_HIDENAME(error, not_supported)
IRCD_EXCEPTION_HIDENAME(error, invalid_argument)

View file

@ -146,7 +146,7 @@ ircd::db::row::operator[](const string_view &column)
{
const auto it(find(column));
if(unlikely(it == end()))
throw not_found("column '%s' does not exist", column);
throw schema_error("column '%s' not specified in the descriptor schema", column);
return *it;
}
@ -157,7 +157,7 @@ const
{
const auto it(find(column));
if(unlikely(it == end()))
throw not_found("column '%s' does not exist", column);
throw schema_error("column '%s' not specified in the descriptor schema", column);
return *it;
}