• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

tarantool / tarantool / 8387828794
88%

Build:
DEFAULT BRANCH: master
Ran 22 Mar 2024 09:08AM UTC
Jobs 1
Files 513
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

22 Mar 2024 08:58AM UTC coverage: 86.999% (+0.02%) from 86.984%
8387828794

push

github

locker
error: allow to specify where to get error location

Currently, the error location (file, line) is always retrieved from
the current stack frame. The new argument `level` allows to change
this. It has the same semantics as the `level` argument of the built-in
Lua function `error`.

Closes #9792

@TarantoolBot document
Title: Document `level` argument of `box.error` and `box.error.new`

Now, when used with a table argument, `box.error` and `box.error.new`
also accept an optional second argument called `level`. It has the same
meaning as the `level` argument of the built-in Lua function `error`:
it specifies how to get the error location. With level 1 (the default),
the error location is where `box.error` / `box.error.new` was called.
Level 2 points the error to where the function that called `box.error` /
`box.error.new` was called; and so on. Passing level 0 avoids addition
of location information to the error.

Example of using `level` with `box.error`:

```lua
local json = require('json')

local function inner(level)
    box.error({message = 'test'}, level)    -- line:4
end

local function outer(level)
    inner(level)                            -- line:8
end

local ok, err
ok, err = pcall(outer)
print(json.encode(err.trace))               -- prints line:4
ok, err = pcall(outer, 1)
print(json.encode(err.trace))               -- prints line:4
ok, err = pcall(outer, 2)
print(json.encode(err.trace))               -- prints line:8
ok, err = pcall(outer, 0)
print(json.encode(err.trace))               -- prints empty table
```

Example of using `level` with `box.error.new`:

```lua
local json = require('json')

local function inner(level)
    local err = box.error.new({message = 'test'}, level)    -- line:4
    return err
end

local function outer(level)
    local err = inner(level)                                -- line:9
    return err
end

local err
err = outer()
print(json.encode(err.trace))               -- prints line:4
err = outer(1)
print(json.enc... (continued)

67061 of 119449 branches covered (56.14%)

41 of 44 new or added lines in 1 file covered. (93.18%)

24 existing lines in 7 files now uncovered.

99632 of 114521 relevant lines covered (87.0%)

2465334.81 hits per line

Jobs
ID Job ID Ran Files Coverage
1 8387828794.1 22 Mar 2024 09:08AM UTC 0
87.0
GitHub Action Run
Source Files on build 8387828794
Detailed source file information is not available for this build.
  • Back to Repo
  • 25cdabe4 on github
  • Prev Build on master (#8361752145)
  • Next Build on master (#8404131065)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc