Menu

#607 Improve exception processing in console mode

3.0
closed-fixed
None
4
2014-04-14
2013-07-23
No

Due to other problems, I found a problem with OmegaT in console mode. The call stack was unclear, making it hard to decipher a problem:

Source file loading complete
Loading TMX files...

Validating tags
An error has occured: java.lang.IndexOutOfBoundsException: Index: 4, Size: 4

Quite hard to decipher what was going wrong.

Suggested change 1:

Extend the exception handler in the last try-catch of runConsoleTranslate, runCreatePseudoTranslateTMX and runConsoleAlign by

} catch (Exception e)) {
    Log.log(e)
    ...
    System.exit...
}

Suggested change 2:
It might be a good moment to check whether the whole code form Log.log(e) upto System.exit(1) should move into a separate procedure.

Suggested change 3:
It might be a good moment to change showError such that when in console mode, it always prints the full stack:

    case CONSOLE_TRANSLATE:
        System.err.println(msg); <<<--- here
        break;

Discussion

  • Didier Briel

    Didier Briel - 2013-12-23
    • summary: Patch for unsufficient call stack on error when tag validation in console mode is done. --> Patch for unsufficient call stack on error when tag validation in console mode is done
    • assigned_to: Alex Buloichik
    • Group: SVN --> 3.0
     
  • Didier Briel

    Didier Briel - 2014-02-10
    • summary: Patch for unsufficient call stack on error when tag validation in console mode is done --> Improve exception processing in console mode
    • status: open --> open-fixed
     
  • Didier Briel

    Didier Briel - 2014-02-10

    Implemented in SVN (/trunk).

    Errors are now better collected and reported.

    At the end of the process, if an error occurs, a message is printed:
    An error occurred while trying to run console process: {0}

    For details, see the technical implementation:
    https://sourceforge.net/p/omegat/svn/6000/

    Didier

     
  • Didier Briel

    Didier Briel - 2014-04-14
    • status: open-fixed --> closed-fixed
     
  • Didier Briel

    Didier Briel - 2014-04-14

    Implemented in the released version 3.1.0 of OmegaT.

    Didier

     

Log in to post a comment.