Improve error handling when creating directories

Summary

In #487761 (closed) we updated the endpoint on the backend to return an error status instead of 200 OK when an error occurs while committing changes in the single file editor.

Since the create directory also uses the same endpoint, the error handling changed to a generic error on the frontend when the backend was updated. We should update the frontend to display the error returned by the backend instead of the hardcoded error on the frontend.