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
{{ message }}
Repository navigation
Multiple error messages for single action. More of an annoyance than a bug. #2704
Marked a group of rows to delete. Rows have unique key.
Instead of pressing the 'delete row' button I accidentally pressed DEL key which deletes the content of the marked column instead of the whole row.
What did you expect to see?
It was a wrong action on my part. But, even so I expected a single error message regarding the key being unique.
What did you see instead?
A single error message for each row affected (thousands of them).
I had to kill the app as it's practically impossible to keep OK-ing thousands of errors.
Useful extra information
The info below often helps, please fill it out if you're able to. :)
Stick a book on the ESC key and come back in 5 mins! 😁😁😂
In an ideal world, you'd need some sort of 'hmm, we seem to be issuing a lot of errors - I'll shut up for a bit' or a '[x] don't show again' option...
I'll flag this as an 'enhancement', but have no idea how feasible something like this would be, due to the nature of the error and where it occurs. You don't want DB4S too silent if things go wrong...
The normal way to solve this kind of problem is make a higher level error routine wrapper that sets a flag for a given error (or all errors, depending on how you want it to behave), and avoid printing it more than once. The flag is reset at the end of each action.
It' quite easy to change this. However, I'm not sure what way to choose:
In case of an error, show a message, and don't continue
In case of an error set an error flag but continue. After processing all rows show a message when the error flag is set.
What do you think? I would like to avoid giving the user a choice here if possible because it just makes this harder to maintain and to use while adding little benefit 99% of the time - or at least I think so.
Depends on the error. If you have a 'create table' statement and 10,000 inserts, you don't want the inserts to fail (10,000 times) if the 'create tab;e' fails. You'd want the first error to not continue. However, if insert #9345 had an error, you wouldn't want to abort, as it would be a pain to work out what to re-do, copy to a new statement, etc, etc.
On the other hand, there is no guarantee or reason why the inserts would be linked to the first statement anyway ... so if the first statement failed it wouldn't matter and could continue.
I'm not helping much am I .... 😉😉😜
I guess I'm leaning more towards the first option - scripts should run successfully, and running 'clean' would encourage that. Running for a while just to get an error would be frustrating - fixing it - running it again processing every line just to know it failed on line #3..... 😣
@chrisjlocke I guess it depends on the context 😄 In this case here (deleting all selected values) the data could be different in case of an error. Option 2 might delete more cells than option 1 because it goes on trying to delete the rest when option 2 just gives up. Here's another way to approach this:
is how setting to NULL works at the moment (which is something I just noticed now)
is how the book on the Escape key would work 😆
Because set to NULL works like option 1) I just changed the normal delete to work the same way. If somebody strongly disagrees we can change both to 2) but I would like to keep them consistent.
@tonypdmtr Can you give tomorrow's nightly build a try and see if this is working ok for you?
In case of an error set an error flag but continue. After processing all rows show a message when the error flag is set.
I'd go with a slight modification of this one. (After all, I do want the action to complete and not abort -- and I'm referring in general and not my particular example which I performed the wrong action. In general, you want the action completed even if there were errors on the way).
But instead of a flag, use a counter initialized to zero. For each error, increment,
That way when counter is non-zero, the error message at the end can also report how many errors were found.
Activity
chrisjlocke commentedon May 18, 2021
Stick a book on the ESC key and come back in 5 mins! 😁😁😂
In an ideal world, you'd need some sort of 'hmm, we seem to be issuing a lot of errors - I'll shut up for a bit' or a '[x] don't show again' option...
I'll flag this as an 'enhancement', but have no idea how feasible something like this would be, due to the nature of the error and where it occurs. You don't want DB4S too silent if things go wrong...
tonypdmtr commentedon May 18, 2021
The normal way to solve this kind of problem is make a higher level error routine wrapper that sets a flag for a given error (or all errors, depending on how you want it to behave), and avoid printing it more than once. The flag is reset at the end of each action.
MKleusberg commentedon May 21, 2021
It' quite easy to change this. However, I'm not sure what way to choose:
What do you think? I would like to avoid giving the user a choice here if possible because it just makes this harder to maintain and to use while adding little benefit 99% of the time - or at least I think so.
chrisjlocke commentedon May 21, 2021
Depends on the error. If you have a 'create table' statement and 10,000 inserts, you don't want the inserts to fail (10,000 times) if the 'create tab;e' fails. You'd want the first error to not continue. However, if insert #9345 had an error, you wouldn't want to abort, as it would be a pain to work out what to re-do, copy to a new statement, etc, etc.
On the other hand, there is no guarantee or reason why the inserts would be linked to the first statement anyway ... so if the first statement failed it wouldn't matter and could continue.
I'm not helping much am I .... 😉😉😜
I guess I'm leaning more towards the first option - scripts should run successfully, and running 'clean' would encourage that. Running for a while just to get an error would be frustrating - fixing it - running it again processing every line just to know it failed on line #3..... 😣
Avoid multiple error messages when deleting cell values
MKleusberg commentedon May 22, 2021
@chrisjlocke I guess it depends on the context 😄 In this case here (deleting all selected values) the data could be different in case of an error. Option 2 might delete more cells than option 1 because it goes on trying to delete the rest when option 2 just gives up. Here's another way to approach this:
Because set to NULL works like option 1) I just changed the normal delete to work the same way. If somebody strongly disagrees we can change both to 2) but I would like to keep them consistent.
@tonypdmtr Can you give tomorrow's nightly build a try and see if this is working ok for you?
tonypdmtr commentedon May 22, 2021
I'd go with a slight modification of this one. (After all, I do want the action to complete and not abort -- and I'm referring in general and not my particular example which I performed the wrong action. In general, you want the action completed even if there were errors on the way).
But instead of a flag, use a counter initialized to zero. For each error, increment,
That way when counter is non-zero, the error message at the end can also report how many errors were found.