Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved error logging #68

Merged
merged 3 commits into from
Oct 11, 2022

Conversation

AnHeuermann
Copy link
Member

@AnHeuermann AnHeuermann commented Oct 10, 2022

Fixes #67.

Changes

  • New error objects for general omc errors and timeout errors.
    • Show full messages from stdout and stderr to user if omc failes to start.
  • Use == and ==! when comparing to nothing
  • Fix Project.toml for older Julia 1.0/ 1.1
  • Update version to 0.2.1
julia> omc=OMJulia.OMCSession()
[ Info: Path to zmq file="/tmp/openmodelica.USER.port.julia.oNnqddn7qq"
ERROR: OMCError
Command `omc --interactive=zmq +z=julia.oNnqddn7qq` failed
Error: You are trying to run OpenModelica as a server using the root user.
This is a very bad idea:
* The socket interface does not authenticate the user.
* OpenModelica allows execution of arbitrary commands.

Execution failed!

Stacktrace:
 [1] OMJulia.OMCSession(omc::Nothing)
   @ OMJulia /workspaces/OMJulia.jl/src/OMJulia.jl:174
 [2] OMJulia.OMCSession()
   @ OMJulia /workspaces/OMJulia.jl/src/OMJulia.jl:89
 [3] top-level scope
   @ REPL[2]:1
julia> omc=OMJulia.OMCSession()
[ Info: Path to zmq file="/tmp/openmodelica.USER.port.julia.jWW4HDd8CY"
ERROR: TimeoutError
ZMQ server port file "/tmp/openmodelica.USER.port.julia.jWW4HDd8CY" not created yet.
Stacktrace:
 [1] OMJulia.OMCSession(omc::Nothing)
   @ OMJulia ~/workdir/julia/OMJulia.jl/src/OMJulia.jl:179
 [2] OMJulia.OMCSession()
   @ OMJulia ~/workdir/julia/OMJulia.jl/src/OMJulia.jl:89
 [3] top-level scope
   @ REPL[2]:1

@AnHeuermann AnHeuermann self-assigned this Oct 10, 2022
@AnHeuermann
Copy link
Member Author

The used Julia is so old, that pipeline can't handle IOBuffer, so I need to use text files.

  - log files for stdout and stderr
  - Display in case of error or debug mode
  - Fix Project.toml for Julia 1.0 / 1.1
@AnHeuermann AnHeuermann merged commit 2147c97 into OpenModelica:master Oct 11, 2022
@AnHeuermann AnHeuermann deleted the improved-error-logging branch October 11, 2022 10:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

OMJulia not working inside Docker container
2 participants