Skip to content

Multiple error messages for single action. More of an annoyance than a bug. #2704

Open

Description

@tonypdmtr

Details for the issue

What did you do?

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. :)

What operating system are you using?

  • Windows: ( version: 7__ )
  • Linux: ( distro: ___ )
  • macOS: ( version: ___ )
  • Other: ___

What is your DB4S version?

  • 3.12.2
  • 3.12.1
  • 3.12.0
  • 3.11.x
  • Other: ___

Did you also

Activity

  1. chrisjlocke commented on May 18, 2021

    @chrisjlocke
    Member

    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...

  2. tonypdmtr commented on May 18, 2021

    @tonypdmtr
    Author

    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.

  3. MKleusberg commented on May 21, 2021

    @MKleusberg
    Member

    It' quite easy to change this. However, I'm not sure what way to choose:

    1. In case of an error, show a message, and don't continue
    2. 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.

  4. chrisjlocke commented on May 21, 2021

    @chrisjlocke
    Member

    However, I'm not sure what way to choose

    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..... 😣

  5. MKleusberg commented on May 22, 2021

    @MKleusberg
    Member

    @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:

    1. is how setting to NULL works at the moment (which is something I just noticed now)
    2. 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?

  6. tonypdmtr commented on May 22, 2021

    @tonypdmtr
    Author
    1. 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions