Move the error-handling code to the builder