Throw errors in debug mode