Fetch error detail in a way suitable for handling in client-side scripts.