inflation / jpegxl-rs

GNU General Public License v3.0
60 stars 11 forks source link

Backtrace Support #80

Open namse opened 3 weeks ago

namse commented 3 weeks ago

Hello, even when an error occurs due to incorrect settings, I only receive the message "The encoder API is used in an incorrect way" without any backtrace. Of course, I have set RUST_BACKTRACE=1.

Is the backtrace disabled by default? If possible, could you enable it so that I can identify which configuration value is causing the issue?

inflation commented 3 weeks ago

That message is coming from the internal libjxl library:

  /** The encoder API is used in an incorrect way.
   *  In this case, a debug build of libjxl should output a specific error
   * message. (if not, please open an issue about it)
   */
  JXL_ENC_ERR_API_USAGE = 0x81,

You could enable vendored feature to build libjxl in debug mode and libjxl should print any error message to stderr.

namse commented 3 weeks ago

What I mean is that the Rust backtrace didn't work. If I could identify which line in this library caused the error, it would naturally be easier to diagnose the problem.

inflation commented 3 weeks ago

Then I'm not doing anything particular.

inflation commented 3 weeks ago

I could include a backtrace in the corresponding error types, but that would change the enum to a struct with a kind, which would be a major break. So I don't think it's worth it.