you can remove the begin/end part, `def` is like an implicit `begin` block, i.e.

```
def build_document
...
rescue
...
end
```