Commit c805d642 authored by Steven Murray's avatar Steven Murray
Browse files

Catalogue::createTape() explains more user error

parent a1ad6f83
......@@ -1378,6 +1378,14 @@ void RdbmsCatalogue::createTape(
throw exception::UserError(std::string("Cannot create tape ") + vid +
" because a tape with the same volume identifier already exists");
}
if(!logicalLibraryExists(*conn, logicalLibraryName)) {
throw exception::UserError(std::string("Cannot create tape ") + vid + " because logical library " +
logicalLibraryName + " does not exist");
}
if(!tapePoolExists(*conn, tapePoolName)) {
throw exception::UserError(std::string("Cannot create tape ") + vid + " because tape pool " +
tapePoolName + " does not exist");
}
const time_t now = time(nullptr);
const char *const sql =
"INSERT INTO TAPE("
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment