That's not really when "the build fails" but when the build creation fails.

The errorThrown received is simply 'Forbidden' and status of the jqXHR is 403 in case permissions are not correctly. I don't know exactly what are the error messages for other failure cases if any.