Explorar o código

Lua error handler for all errors

bel %!s(int64=11) %!d(string=hai) anos
pai
achega
b5da6dbcaa
Modificáronse 1 ficheiros con 12 adicións e 0 borrados
  1. 12 0
      test/error.lua

+ 12 - 0
test/error.lua

@@ -0,0 +1,12 @@
+mg.write("HTTP/1.0 200 OK\r\n")
+mg.write("Content-Type: text/html\r\n")
+mg.write("\r\n")
+mg.write([[<html><body>
+  <p>Lua error handler:</p>
+  <p>Status code: ]])
+
+mg.write(tostring(mg.request_info.status))
+
+mg.write([[</p>
+</body></html>
+]])