API : Set custom error handler for test environment