Suneido

Integrated Application Platform

  • Home
  • Learning
    • Suneido Manual
    • Beginners
      • Inside Suneido
      • The Suneido Programming Language
      • The Suneido Database
      • Installing Suneido
      • Building Suneido
      • IDE Go To Tour
      • Upgrading To A New Release
    • Advanced
      • Canvas Control
      • DrawControl Part 1
      • DrawControl Part 2
      • DrawControl Part 3
      • SAX Like XML Processing
      • A Plug-In Architecture
      • A Simple Wizard Framework
      • An HTML Include Facility
      • An RSS 2 Feed Creator
      • MIME Generation
      • A New Add-on Facility
      • Workspace Improvement Hack
    • Mockito for Suneido
    • The Suneido Task Scheduler
    • Contributing To Suneido
    • Contributor Assignment of Copyright
    • Language Translation
    • Future Directions
    • Interview With Andrew Mckinlay
  • Forum
    • Announcements
    • Internals & Enhancements
    • Cookbook
    • General
  • FAQ
  • Screenshots
  • Downloads
  • Links

[SOLVED]AlertError does not stop code execution

Integrated Application Platform › Forums › General › [SOLVED]AlertError does not stop code execution

  • This topic has 4 replies, 2 voices, and was last updated 8 years, 7 months ago by jaska_lee.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • August 14, 2014 at 3:34 pm #780
    jaska_lee
    Participant

    I understand that suneido provides throw and AlertError for error handling. Throw is more useful for debugging which is aimed for developers alike and AlertError is more user friendly for ordinary users. So I would like to use AlertError but it seems that it does not stop code execution. Is that the case or have i misunderstood something? Is there any option to show error message and stop any further code execution at once?

    Furthermore, I would also like to rollback all database changes whenever an error message is encountered. Is that possible? Or do I have to handle database rolling back inside of a transaction always?

    August 14, 2014 at 4:06 pm #1070
    amckinlay
    Keymaster

    AlertError is just an Alert (MessageBox) with an “error” icon. It is not intended to stop execution.

    In a GUI program, “stopping” is not quite the same as in straight procedural code. e.g. if you are in a button handler, you can just return to not do anything further for that button press.

    To roll back database changes, you need to be inside a transaction. (And database changes must be specifically associated with that transaction in order to be rolled back.)

    If you use the “block” form of Transaction and the code throws an exception, then the transaction is automatically aborted and the changes rolled back.

    I hope that helps.

    August 15, 2014 at 3:35 am #1071
    jaska_lee
    Participant

    Hi Andrew,

    Thanks for your help indeed.

    Alter: I had a look into your accounting application and you are right. Using Alter followed by Return seems to stop going further. But I am concerned that in the case which more than one functions are invoked, while the fist might be stopped, the others will still be called after the first. Is this the only way to go for now?

    Throw: I notice that using throw without try/catch does stop code execution. But I am cautious and try not to show the debug window to end users. In the past, I had some painful experiences even if the error message is short and sweet. That debug window is nice for developers but is likely to drive the users mad at me 🙂 .

    Thanks for the tips regarding database rollbak. I will keep that in mind.

    August 15, 2014 at 6:10 pm #1072
    amckinlay
    Keymaster

    If Suneido.User is set to something different than “default” then the debugger will not be displayed. A more user friendly message is shown.

    August 18, 2014 at 1:19 am #1073
    jaska_lee
    Participant

    Nice, thanks for pointing that out Andrew.

  • Author
    Posts
Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.
Log In

Search Forums

Log In
Welcome to the new Suneido Web Site and Forum.
Register
Lost Password
users of the previous PHPBB Forum should be able to log in with their previous username and password.

Recent Topics

  • Alpha copy of gSuneido to play with
  • how to start jsuneido ?
  • Problem Starting Suneido…
  • Dialog not showing buttons
  • New link for Suneidojo

Contact Us | Legal Statement | Privacy Statement | SiteMap

Copyright © 2023 Axon® Development Corporation. All Rights Reserved. - Open Source Integrated Database and Programming Language