Discussion Closed This discussion was created more than 6 months ago and has been closed. To start a new discussion with a link back to this one, click here.

Mesh Error Exception handling

Please login with a confirmed email address before reporting spam

Hello Colleauges,

I am working on creating a routine in java, which will attempt to create a mesh for each instance of a parameter defined within a sweep before the solution is computed. Last thing we want to experience is a crash of some job only due to something we could have checked earlier, don't we?
I know this can be done in java using try-catch statements, but in contrary to MATLAB, java would like to know what sort of exception it is supposed to react to:

try
{
doMesh();
}
catch(ExceptionType err)
{
trySomethingDifferent();
}

Could you tell me what exception I should expect?
I am sending an attachment that shows a typical message after builing mesh has failed.

Thank you very much for your help!
Kind Regards
Oleg


1 Reply Last Post 23 set 2015, 08:48 GMT-4

Please login with a confirmed email address before reporting spam

Posted: 9 years ago 23 set 2015, 08:48 GMT-4

try
{
doMesh();
}
catch(ExceptionType err)
{
trySomethingDifferent();
}


Alright, for now I have specified "ExceptionType" as just an "Exception". The code compiles and the situation is fine, as long as I don't need to refer to any specifics of the error...
[QUOTE] try { doMesh(); } catch(ExceptionType err) { trySomethingDifferent(); } [/QUOTE] Alright, for now I have specified "ExceptionType" as just an "Exception". The code compiles and the situation is fine, as long as I don't need to refer to any specifics of the error...

Note that while COMSOL employees may participate in the discussion forum, COMSOL® software users who are on-subscription should submit their questions via the Support Center for a more comprehensive response from the Technical Support team.