added method hasError and getErrorPage