You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I believe if you had an iModel with atleast two elements you could call iModel.relationships.insertInstance with the same props twice and get the error message: "Error: sql error".
If one were to enable SQLite logging with Logger.setLevel(NativeLoggerCategory.SQLite, LogLevel.Error);
You would in addition to Error: sql error, also see
Error | SQLite | rc=2067, abort at 27 in [INSERT INTO [bis_ElementRefersToElements] ([Id],[ps1],[SourceId],[TargetId],ECClassId) VALUES (:_ecdb_ecsqlparam_ix1_col1,:_ecdb_ecsqlparam_ix2_col1,:_ecdb_ecsqlparam_ix3_col1,:_ecdb_ecsqlparam
Message from Affan when asked about throwSqlError():
"We have really not very good error propagation. We return DbResult from most function since underlaying sql return that but we also return BE_SQLITE_ERROR in our own validation logic.
so people have to look up log if any to find what went wrong since we log some error message but not in all cases
a better way to do this is to use throw in cpp code
I believe if you had an iModel with atleast two elements you could call iModel.relationships.insertInstance with the same props twice and get the error message: "Error: sql error".
If one were to enable SQLite logging with
Logger.setLevel(NativeLoggerCategory.SQLite, LogLevel.Error);
You would in addition to Error: sql error, also see
A search of "sqlite 2067" leads you to https://www.sqlite.org/rescode.html#constraint_unique. A user should not have to enable SQLite logging in order to know that they got a unique constraint error.
My suggestion is to start off with a test in core/backend which produces the error message "Error: sql error"
Where the error occurs in imodel-native code
The text was updated successfully, but these errors were encountered: