Better handling of errors and exceptions when new view name already
exists
This commit is contained in:
@ -128,6 +128,8 @@ extern int obi_errno;
|
||||
*/
|
||||
#define OBI_JSON_ERROR (34) /** Error related to JSON operations.
|
||||
*/
|
||||
#define OBIVIEW_ALREADY_EXISTS_ERROR (35) /** Tried to create a new view with a name already existing in the DMS.
|
||||
*/
|
||||
/**@}*/
|
||||
|
||||
#endif /* OBIERRNO_H_ */
|
||||
|
@ -1496,8 +1496,8 @@ Obiview_p obi_new_view(OBIDMS_p dms, const char* view_name, Obiview_p view_to_cl
|
||||
// Check uniqueness of name
|
||||
if (view_exists(dms, view_name))
|
||||
{
|
||||
obi_set_errno(OBIVIEW_ERROR);
|
||||
obidebug(1, "\nName of new view already exists");
|
||||
obi_set_errno(OBIVIEW_ALREADY_EXISTS_ERROR);
|
||||
obidebug(1, "\nName of new view ('%s') already exists", view_name);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user