Add more descriptive errors to `doc/diag.py`

Signed-off-by: Paul Colomiets <paul@colomiets.name>
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>