Skip to content

error handling #141

Open
Open

Description

@mm580486

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 ?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions