[pt::Builder] add error handling

first pass at some of the TODO items
Please do not add `unwrap()`s in user-facing paths any more, use `expect` (with `line!()`).