Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/google-app-engine/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Google app engine 是否可以使用Go on Google App Engine设置默认错误页面_Google App Engine_Go_Internal Server Error_Panic - Fatal编程技术网

Google app engine 是否可以使用Go on Google App Engine设置默认错误页面

Google app engine 是否可以使用Go on Google App Engine设置默认错误页面,google-app-engine,go,internal-server-error,panic,Google App Engine,Go,Internal Server Error,Panic,我以前使用过J2EE,可以将此配置添加到web.xml <error-page> <exception-type>java.lang.Throwable</exception-type> <location>/error</location> </error-page> java.lang.Throwable /错误 上述代码的作用是,如果抛出了未经处理的异常,它将被传递到/error页

我以前使用过J2EE,可以将此配置添加到
web.xml

<error-page>
        <exception-type>java.lang.Throwable</exception-type>
        <location>/error</location>
</error-page>

java.lang.Throwable
/错误
上述代码的作用是,如果抛出了未经处理的异常,它将被传递到
/error
页面,该页面将显示给用户

当我的Go web应用程序在Google App Engine上陷入恐慌时,有没有类似的方法可以做到这一点?

是的,请参阅:

当发生某些错误时,应用程序引擎将提供一个通用错误页面。你 可以将应用程序配置为提供自定义静态文件,而不是这些文件 通用错误页,只要自定义错误数据小于10 千字节。您可以设置不同的静态文件,以便为每个 通过指定应用程序的app.yaml中的文件支持的错误代码 文件要提供自定义错误页面,请将错误处理程序部分添加到 您的app.yaml,如本例所示:

error_handlers:
  - file: default_error.html

  - error_code: over_quota
    file: over_quota.html

完美的这正是我想要的