librelist archives

« back to archive

IE10: application error handler issue

IE10: application error handler issue

From:
Laszlo Papp
Date:
2013-12-04 @ 12:05
Hi,

it seems the following code does raise an error page in IE 10 with the
corresponding http status code, but it does not show the string for
some reason.

{code}

@application.errorhandler(FormError)
def formErrorExceptionHandler(error):
    return str(error), 400

....

raise FormError('foo')

....

{/code}

Perhaps, I need to prepare with the html body explicitly rather than
the raw string? Interestingly enough, it works with firefox and
chromium, but not IE 10.

Cheers,
Laszlo

Re: [flask] IE10: application error handler issue

From:
Laurent Meunier
Date:
2013-12-04 @ 13:21
Hi,

On 04/12/2013 13:05, Laszlo Papp wrote:
> Hi,
>
> it seems the following code does raise an error page in IE 10 with the
> corresponding http status code, but it does not show the string for
> some reason.
>
>[snip]
>
> Perhaps, I need to prepare with the html body explicitly rather than
> the raw string? Interestingly enough, it works with firefox and
> chromium, but not IE 10.

IE will display a "friendly" error message if your error page is too 
small (the minimum size depends on the HTTP code).

http://www.404-error-page.com/404-error-page-too-short-problem-microsoft-ie.shtml

Try to add some garbage in your error message to have more than 512 
bytes. I don't know if it's possible to disable this behavior in IE.


Regards,
-- 
Laurent Meunier <laurent@deltalima.net>

Re: [flask] IE10: application error handler issue

From:
Laszlo Papp
Date:
2013-12-04 @ 16:47
On Wed, Dec 4, 2013 at 1:21 PM, Laurent Meunier <laurent@deltalima.net> wrote:
> Hi,
>
> On 04/12/2013 13:05, Laszlo Papp wrote:
>> Hi,
>>
>> it seems the following code does raise an error page in IE 10 with the
>> corresponding http status code, but it does not show the string for
>> some reason.
>>
>>[snip]
>>
>> Perhaps, I need to prepare with the html body explicitly rather than
>> the raw string? Interestingly enough, it works with firefox and
>> chromium, but not IE 10.
>
> IE will display a "friendly" error message if your error page is too
> small (the minimum size depends on the HTTP code).
>
> 
http://www.404-error-page.com/404-error-page-too-short-problem-microsoft-ie.shtml
>
> Try to add some garbage in your error message to have more than 512
> bytes. I don't know if it's possible to disable this behavior in IE.

Thanks Laurent. You saved me a lot of headache. Also, It made my day.
It is truly amusing. :-)

Re: [flask] IE10: application error handler issue

From:
gioi
Date:
2013-12-04 @ 16:17
Il 04/12/2013 13:05, Laszlo Papp ha scritto:
> Hi,
>
> it seems the following code does raise an error page in IE 10 with the
> corresponding http status code, but it does not show the string for
> some reason.
Check out these links:
   
http://www.404-error-page.com/404-error-page-too-short-problem-microsoft-ie.shtml
   

http://blogs.msdn.com/b/ieinternals/archive/2010/08/19/http-error-pages-in-internet-explorer.aspx

Re: [flask] IE10: application error handler issue

From:
Laszlo Papp
Date:
2013-12-04 @ 16:48
On Wed, Dec 4, 2013 at 4:17 PM, gioi <g@gioi.tk> wrote:
> Il 04/12/2013 13:05, Laszlo Papp ha scritto:
>> Hi,
>>
>> it seems the following code does raise an error page in IE 10 with the
>> corresponding http status code, but it does not show the string for
>> some reason.
> Check out these links:
>
> 
http://www.404-error-page.com/404-error-page-too-short-problem-microsoft-ie.shtml
>
> 
http://blogs.msdn.com/b/ieinternals/archive/2010/08/19/http-error-pages-in-internet-explorer.aspx

Yes, I fixed it after Laurent's email, but thank you to you, too!

Re: [flask] IE10: application error handler issue

From:
gioi
Date:
2013-12-04 @ 16:55
Il 04/12/2013 17:48, Laszlo Papp ha scritto:
> Yes, I fixed it after Laurent's email, but thank you to you, too!
Sorry Laurent - didn't notice your email ;-)