# callee

Source: https://ref.dm-lang.org/callee
Added in BYOND 516.

A primitive type representing a running or sleeping proc. This gives access to the proc's information, and can be used to output a stack trace in situations such as writing your own custom `world.Error()` handler.

You can get a `/callee` for the current running proc with its [callee](https://ref.dm-lang.org/proc/var/callee.md) var, or its caller with the [caller](https://ref.dm-lang.org/proc/var/caller.md) var. You can follow callers up the call chain.

```dm
world/Error(err)
    world.log << "Error [err]:"
    for(var/callee/p = caller, p, p = p.caller)
        world.log << "  [p.proc.type] (src=[p.src], usr=[p.usr])"
        if(p.file) world.log << "    at [p.file]:[p.line]"
```

Built-in callee vars (read-only):

<sup>*</sup> These vars are quick aliases for `proc.*varname*`. `proc.type` is excluded since `/callee` has its own type var.

The `file` and `line` vars are available if debugging information was turned on when the world was compiled. The other vars are all aliases for info about the running/sleeping proc or its prototype.

Even though the `args` var itself is read-only, the list it returns is mutable. Making changes to the list will affect the proc it belongs to.

### See also
- [proc](https://ref.dm-lang.org/proc/index.md)
- [vars (proc)](https://ref.dm-lang.org/proc/var/index.md)
- [callee var (proc)](https://ref.dm-lang.org/proc/var/callee.md)
- [caller var (proc)](https://ref.dm-lang.org/proc/var/caller.md)
- [Error proc (world)](https://ref.dm-lang.org/world/proc/Error.md)
- [try and catch statements](https://ref.dm-lang.org/proc/try.md)
