Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gracefully handle no container error #28

Open
strzibny opened this issue Jul 18, 2019 · 1 comment
Open

Gracefully handle no container error #28

strzibny opened this issue Jul 18, 2019 · 1 comment

Comments

@strzibny
Copy link

I am using erlazure via ex_azure and the call to put_blob fails with:

[error] GenServer #PID<0.1678.0> terminating
** (stop) bad return value: "\uFEFF<?xml version=\"1.0\" encoding=\"utf-8\"?><Error><Code>ContainerNotFound</Code><Message>The specified container does not exist.\nRequestId:b66001fa-d01e-005e-308e-3d06c6000000\nTime:2019-07-18T17:32:06.5364180Z</Message></Error>"
Last message (from #PID<0.93.0>): {:put_blob, 'container', 'new_file.pdf', :block_blob, <<37, 80, 68, 70, 45, 49, 46, 51, 10, 37, 255, 255, 255, 255, 10, 49, 32, 48, 32, 111, 98, 106, 10, 60, 60, 32, 47, 67, 114, 101, 97, 116, 111, 114, 32, 60, 102, 101, 102, 102, 48, 48, 53, 48, 48, ...>>, 

When I was trying to find the culprit in ex_azure I realized it simply just calls handle_call({put_blob, Container, Name, Type = block_blob, Data, Options}, _From, State) -> from erlazure.

The issue is that Azure returns the XML error, but there is no graceful failure of it. It simply makes the GenServer to fail... I would probably except that an error tuple with the error message is returned.

@dotdotdotpaul
Copy link

Running into this too -- can't seem to catch/rescue from the failure in my caller, either. 😛

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants