Skip to content

Commit

Permalink
Merge pull request #138 from schomatis/fix/client/expand-on-api-error
Browse files Browse the repository at this point in the history
expand on the api error
  • Loading branch information
schomatis authored Dec 27, 2018
2 parents a1f72b8 + bbed845 commit 55588cf
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions http/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package http

import (
"context"
"errors"
"fmt"
"io"
"net"
Expand All @@ -20,10 +19,6 @@ const (
ApiUrlFormat = "%s%s/%s?%s"
)

var (
ErrAPINotRunning = errors.New("api not running")
)

var OptionSkipMap = map[string]bool{
"api": true,
}
Expand Down Expand Up @@ -85,7 +80,7 @@ func (c *client) Execute(req *cmds.Request, re cmds.ResponseEmitter, env cmds.En
res, err := c.Send(req)
if err != nil {
if isConnRefused(err) {
err = ErrAPINotRunning
err = fmt.Errorf("cannot connect to the api. Is the deamon running? To run as a standalone CLI command remove the api file in `$IPFS_PATH/api`")
}
return err
}
Expand Down

0 comments on commit 55588cf

Please sign in to comment.