We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 7903
    • 9 Posts
    Hi there,

    I’ve been using ModX for a while and have to say that I love it. However, I do wish there was a way to edit those ugly error pages that say things like:

    « MODx Parse Error »
    MODx encountered the following error while attempting to parse the requested resource:
    « PHP Parse Error »

    PHP error debug
    Error: Unknown(): php_network_getaddresses: getaddrinfo failed: Name or service not known
    Error type/ Nr.: Warning - 2
    File: -path- (691) : eval()’d code
    Line: 5

    Parser timing
    MySQL: 0.0040 s s (6 Requests)
    PHP: 13.0995 s s
    Total: 13.1035 s s

    How do I edit those?
      • 31337
      • 258 Posts
      Catch the errors in your own code so they don’t propogate up to the core code.
        • 7903
        • 9 Posts
        That would be ideal, but errors do happen and I’d like to clean up that error page. How do I do that? Thank you.
          • 31337
          • 258 Posts
          That unfortunately required hacking the core code as that’s currently not a configurable option. Look in manager/include/document.parser.php and search for the error message strings in there
            • 7903
            • 9 Posts
            That is a gigantic file. I searched through it some and found: $php_errormsg. Where would that variable be stored?

            Thanks.
              • 31337
              • 258 Posts
              Look at the function messageQuit on line 2319.

              But I would still *strongly* recommend you don’t hack this -- it’s much easier to check and catch errors within your own code. This function should only get called for php syntax or sql errors. Your users should never see it if you’ve tested you site properly and have made your own error checking code.
                • 7903
                • 9 Posts
                It only happens every now and then (seems to have when the server’s load is high and I guess that Apache and/or PHP fails). I just wanted to add a note on there - not really changing it around that much.

                Thanks!