Added custom errors support