trap errors in razordoc