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

error handling #141

Open
mm580486 opened this issue Feb 17, 2018 · 0 comments
Open

error handling #141

mm580486 opened this issue Feb 17, 2018 · 0 comments

Comments

@mm580486
Copy link

hi
i want return DO errors as json for sample i create one droplet like this
<DropletKit::Droplet {:@name=>"zoodfish", :@region=>"blah blah", :@size=>"512mb", :@image=>14782899, :@ipv6=>true, :@tags=>["namechip"], :@id=>nil, :@memory=>nil, :@vcpus=>nil, :@disk=>nil, :@locked=>nil, :@created_at=>nil, :@status=>nil, :@backup_ids=>nil, :@snapshot_ids=>nil, :@action_ids=>nil, :@features=>nil, :@networks=>nil, :@kernel=>nil, :@size_slug=>nil, :@names=>nil, :@volumes=>nil, :@ssh_keys=>nil, :@backups=>nil, :@monitoring=>nil, :@user_data=>nil, :@private_networking=>nil}>

and DropletKit gem return this


DropletKit::FailedCreate: You specified an invalid region for Droplet creation.
	from (irb):138

but i want make error response like this

{status: 400,message: 'something worng OR else'}

for sample status 400 point to invalid region

how can i make this response ?

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

1 participant