Forum Discussion

FICO's avatar
FICO
Community Manager
8 years ago

Unable to catch an exception while initializing BCL -XPRB.init()

I am using BCL in C# application. When I call XPRB.init() method it executes successfully on the system where FICO Xpress is installed with a valid license but if in case there is a problem with installation or license it fails.

In the case where it fails, it should throw an exception so that it could be caught but even after writing this in try catch block it did not throw any exception and it exits from the debugger and stops the service itself.

So is there any Exception class from BCL library which can be used to catch this or any other way which could help?

1 Reply

  • FICO's avatar
    FICO
    Community Manager

    By default, BCL automatically terminates on errors. This can be disabled by setting the Error Control flag to 0, i.e. calling XPRB.setErrCtrl(0).

    Please see Section 7.1.3 of the BCL Reference Manual, which includes an example that shows how to check XPRB.init return codes.

    Also note that XPRB.init() can both fail with a license error and a return code, or some other C# exception (e.g. a DllNotFoundException if it cannot find one of the dependency dlls).