First read the explanations at
MSDN[
^]...
Now the part not in there... When mode is ON the default error handler not called on unexpected errors - but redirected immediately to the custom error page - except you are on localhost (and in debug mode)...
The moment you are browsing with the IP it considered not local and you get no hit for the error handler, while from VS you are going to localhost...
A good reading:
Complete Example for Error Handlers[
^]