Commits

agentzh (Yichun Zhang)  committed e3e13d2

docs: better error handling in the code sample. thanks wgm.china for the report.

  • Participants
  • Parent commits 085fe7e

Comments (0)

Files changed (1)

File README.markdown

                 local chunk_size = 5 -- should be set to 4096 or 8192
                                      -- for real-world settings
 
-                local form = upload:new(chunk_size)
+                local form, err = upload:new(chunk_size)
+                if not form then
+                    ngx.log(ngx.ERR, "failed to new upload: ", err)
+                    ngx.exit(500)
+                end
 
                 form:set_timeout(1000) -- 1 sec