Loading…
None
New source string testing_project / Documentation: reference/reference_lua/box_error/set — English |
Loading…
None
New source string testing_project / Documentation: reference/reference_lua/box_error/set — English |
local error1 = box.error.new({ code = 500, reason = 'Custom error 1' })
local error2 = box.error.new({ code = 505, reason = 'Custom error 2' })
-- Raise the first error --
box.error(error1)
--[[
---
- error: Custom error 1
...
--]]
-- Get the last error --
box.error.last()
--[[
---
- Custom error 1
...
--]]
-- Set the second error as the last error --
box.error.set(error2)
--[[
---
...
--]]
-- Get the last error --
box.error.last()
--[[
---
- Custom error 2
...
--]]