pymapdl icon indicating copy to clipboard operation
pymapdl copied to clipboard

Report Error File

Open akaszynski opened this issue 4 years ago • 6 comments

Create a new attribute named files and allow the reporting of mapdl specific files. This should be done in the same approach as we use for the parameters and post_processing attributes. For example

mapdl.files.output_error_file()

This way we can capture the error file output when the server dies:

~/ansys/source/pymapdl/ansys/mapdl/core/errors.py in wrapper(*args, **kwargs)
    115             # Must close unfinished processes
    116             mapdl._close_process()
--> 117             raise MapdlExitedError('MAPDL server connection terminated') from None
    118 
    119         if threading.current_thread().__class__.__name__ == '_MainThread':

MapdlExitedError: MAPDL server connection terminated

We need to report the server died and then include the entire error printout in the exception. This will only work when MAPDL is local, but it's better than our current obscure error.

akaszynski avatar Sep 10 '21 15:09 akaszynski

Hello, I would like to ask what is the problem with the application of the above method (sorry,I am a beginner)

Traceback (most recent call last): File "D:\Python\lib\idlelib\run.py", line 559, in runcode exec(code, self.locals) File "C:\Users\abc\Desktop\1\R\新建文件夹\Main-with-uncertainty.py", line 73, in mapdl.files.output_error_file() AttributeError: 'MapdlGrpc' object has no attribute 'files'

donald-zero avatar Jul 13 '23 03:07 donald-zero

Hi @donald-zero

It has not being implemented yet, hence you cannot use it :)

germa89 avatar Jul 14 '23 16:07 germa89

How do you intend it to use it?

germa89 avatar Jul 14 '23 16:07 germa89

Because when I run the program I always get “MapdlExitedError: MAPDL server connection terminated”

donald-zero avatar Jul 15 '23 00:07 donald-zero

Sorry, I meant, "why do you want to use it?". What kind of information are you looking for in the output file?

germa89 avatar Jul 17 '23 10:07 germa89

I want to know why my program is running with this error, find the reason and fix it. Also, thank you very much for your answer!

donald-zero avatar Jul 18 '23 01:07 donald-zero