Added callback for error management

Signed-off-by: Levi LIRVAT <levi.lirvat@niji.fr>