| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Avoid wrapping a Dynlink `Cannot_open_dynamic_library` error into
another `Cannot_open_dynamic_library` error:
- rewrite the platform-specific (bytecode and native) `load`
implementations to ensure they raise only `DT.Error` exceptions, by
always catching other exceptions and wrapping them into
`Cannot_open_dynamic_library` errors,
- remove the systematic wrapping of exceptions in `Dynlink_common`.
Adopt `%s` rather than `%S` to display the inner exceptions in the
exception printer for `DT.Error (Cannot_open_dynamic_library _)` to
avoid double escaping
In particular, trying to link a non-existent file in the native
implementation gives the hard-to-parse message:
Fatal error: exception Dynlink.Error (Dynlink.Cannot_open_dll "Dynlink.Error (Dynlink.Cannot_open_dll \"Failure(\\\"...: cannot open shared object file: No such file or directory\\\")\")")
This patch turns this message into:
Fatal error: exception Dynlink.Error (Dynlink.Cannot_open_dll Failure("...: cannot open shared object file: No such file or directory"))
|