Skip to content

Commit

Permalink
fix: return errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Fady Farid committed Apr 29, 2019
1 parent c46aebc commit 20b6f71
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions dns_records.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func (d *DNSRecordsServiceHandler) Create(ctx context.Context, domain, recordTyp
req, err := d.client.NewRequest(ctx, http.MethodPost, uri, values)

if err != nil {
return nil
return err
}

err = d.client.DoWithContext(ctx, req, nil)
Expand All @@ -73,7 +73,7 @@ func (d *DNSRecordsServiceHandler) Delete(ctx context.Context, domain, recordID
req, err := d.client.NewRequest(ctx, http.MethodPost, uri, values)

if err != nil {
return nil
return err
}

err = d.client.DoWithContext(ctx, req, nil)
Expand Down
4 changes: 2 additions & 2 deletions ssh_key.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func (s *SSHKeyServiceHandler) Create(ctx context.Context, name, sshKey string)
req, err := s.client.NewRequest(ctx, http.MethodPost, uri, values)

if err != nil {
return nil, nil
return nil, err
}

key := new(SSHKey)
Expand Down Expand Up @@ -70,7 +70,7 @@ func (s *SSHKeyServiceHandler) Destroy(ctx context.Context, sshKeyID string) err
req, err := s.client.NewRequest(ctx, http.MethodPost, uri, values)

if err != nil {
return nil
return err
}

err = s.client.DoWithContext(ctx, req, nil)
Expand Down
4 changes: 2 additions & 2 deletions startup_script.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ func (s *StartupScriptServiceHandler) Create(ctx context.Context, name, script,
req, err := s.client.NewRequest(ctx, http.MethodPost, uri, values)

if err != nil {
return nil, nil
return nil, err
}

ss := new(StartupScript)
Expand Down Expand Up @@ -102,7 +102,7 @@ func (s *StartupScriptServiceHandler) Destroy(ctx context.Context, scriptID stri
req, err := s.client.NewRequest(ctx, http.MethodPost, uri, values)

if err != nil {
return nil
return err
}

err = s.client.DoWithContext(ctx, req, nil)
Expand Down
4 changes: 2 additions & 2 deletions user.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func (u *UserServiceHandler) Create(ctx context.Context, email, name, password,
req, err := u.client.NewRequest(ctx, http.MethodPost, uri, values)

if err != nil {
return nil, nil
return nil, err
}

user := new(User)
Expand Down Expand Up @@ -81,7 +81,7 @@ func (u *UserServiceHandler) Delete(ctx context.Context, userID string) error {
req, err := u.client.NewRequest(ctx, http.MethodPost, uri, values)

if err != nil {
return nil
return err
}

err = u.client.DoWithContext(ctx, req, nil)
Expand Down

0 comments on commit 20b6f71

Please sign in to comment.