zserio icon indicating copy to clipboard operation
zserio copied to clipboard

Disabling try catch exceptions

Open Mallikarjuna-Mbrdi opened this issue 11 months ago • 2 comments

Is your feature request related to a problem? Please describe. We have a project guidelines where try catch exception handling is prohibited.

Describe the solution you'd like is it possible to provide a flag which can disable the exception handling during the c++ code generation(example: -setCppAllocator polymorphic)?

Describe alternatives you've considered I am planning to edit the generated code, like logging and returning in place of throwing an exception.

Additional context If Disabling during the generation is possible, please let me know the release version. or is it possible to make this feature available in zserio-2.14.0?

Mallikarjuna-Mbrdi avatar Jan 17 '25 05:01 Mallikarjuna-Mbrdi

Please free to suggest some workaround to handle the removal of exceptions.

Mallikarjuna-Mbrdi avatar Jan 17 '25 05:01 Mallikarjuna-Mbrdi

OK. I understand.

The main problem is that the generated C++ code relies on exceptions by design. There is no feasible way to slightly modify the Zserio C++ generator to disable exceptions. The only approach I can see involves a significant redesign and rewrite of the Zserio C++ generator. However, this is far beyond our current capabilities.

Perhaps, proper documentation of all possible exceptions that can be thrown during reading (parsing) would be sufficient for your project. If so, we have such documentation available just because of this reason.

mikir avatar Jan 17 '25 08:01 mikir