Updated error handling dev/prod