Change request #774

Add error class and enum for loading resources

Added by David Demelier 3 months ago. Updated 3 months ago.

Status:NewStart date:03/19/2018
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:-Estimated time:4.00 h
Target version:0.2
MFD after: Bookmark:@
MFD revision: Submitted by:
Branch:default

Description

At the moment, when we load a resource, we have no idea what fails except an error message thrown in an exception. This is convenient for the user but as the developer we needs more details on what actually happened. For example, when loading a sprite and the image could not be found, we won't parse the error message to deal with that kind of error. Having error code contained in the error class, we could also make more robust unit tests.

We need to implement this for all resources loaded at runtime, for the moment, focus on JSON based resources:

  • mlk::client::loader::load_sprite
  • mlk::client::loader::load_animation

See in http://hg.malikania.fr/irccd/file/bfe72134286f/libirccd/irccd/daemon/server.hpp#l902 how it's implemented (using std::system_error + std::error_code)

History

#1 Updated by David Demelier 3 months ago

  • Description updated (diff)

#2 Updated by David Demelier 3 months ago

  • Description updated (diff)

Also available in: Atom PDF