modio-sdk-legacy icon indicating copy to clipboard operation
modio-sdk-legacy copied to clipboard

modioInit should return error on failure

Open SupSuper opened this issue 6 years ago • 1 comments

Currently if there's an error in modioInit due to an invalid parameter (eg. invalid root path, no write permissions, etc) the SDK just fails silently since nothing is logged and any web requests will just respond normally.

  • Check for errors in modioInit and return true/false appropriately (will need an explicit ::init for C++)
  • If the logger failed, log errors to stderr instead.

SupSuper avatar Aug 20 '19 06:08 SupSuper

As a follow up from our chat on discord, it looks the best option so far is:

  1. Separate the init from the constructor on C++
  2. Return a bool modio was initialised flag on the init method
  3. In case mod.io could not initialize output a message via stderr

Turupawn avatar Aug 21 '19 22:08 Turupawn