Added graceful handling of raised errors, and added an error for bad head_sha request
Add license