diff --git a/docs/content/en/docs/config/grpc/services/appprovider/_index.md b/docs/content/en/docs/config/grpc/services/appprovider/_index.md index 9adab6c6d6b..b214810c84b 100644 --- a/docs/content/en/docs/config/grpc/services/appprovider/_index.md +++ b/docs/content/en/docs/config/grpc/services/appprovider/_index.md @@ -9,7 +9,7 @@ description: > # _struct: config_ {{% dir name="iopsecret" type="string" default="" %}} -The iopsecret used to connect to the wopiserver. [[Ref]](https://github.com/cs3org/reva/tree/master/internal/grpc/services/appprovider/appprovider.go#L59) +The iopsecret used to connect to the wopiserver. [[Ref]](https://github.com/cs3org/reva/tree/master/internal/grpc/services/appprovider/appprovider.go#L57) {{< highlight toml >}} [grpc.services.appprovider] iopsecret = "" @@ -17,7 +17,7 @@ iopsecret = "" {{% /dir %}} {{% dir name="wopiurl" type="string" default="" %}} -The wopiserver's URL. [[Ref]](https://github.com/cs3org/reva/tree/master/internal/grpc/services/appprovider/appprovider.go#L60) +The wopiserver's URL. [[Ref]](https://github.com/cs3org/reva/tree/master/internal/grpc/services/appprovider/appprovider.go#L58) {{< highlight toml >}} [grpc.services.appprovider] wopiurl = "" diff --git a/internal/grpc/services/appprovider/appprovider.go b/internal/grpc/services/appprovider/appprovider.go index 6f41a9f6259..cca7bd89c32 100644 --- a/internal/grpc/services/appprovider/appprovider.go +++ b/internal/grpc/services/appprovider/appprovider.go @@ -22,13 +22,11 @@ import ( "bytes" "context" "encoding/json" - "errors" "fmt" "io/ioutil" "net/http" "net/url" "path" - "strconv" "strings" "time" @@ -134,7 +132,7 @@ func (s *service) getWopiAppEndpoints(ctx context.Context) (map[string]interface } defer appsRes.Body.Close() if appsRes.StatusCode != http.StatusOK { - return nil, errors.New("Request to WOPI server returned " + string(appsRes.StatusCode)) + return nil, fmt.Errorf("Request to WOPI server returned %d", appsRes.StatusCode) } appsBody, err := ioutil.ReadAll(appsRes.Body) if err != nil { @@ -201,7 +199,7 @@ func (s *service) OpenFileInAppProvider(ctx context.Context, req *providerpb.Ope if openRes.StatusCode != http.StatusOK { res := &providerpb.OpenFileInAppProviderResponse{ - Status: status.NewInvalid(ctx, "appprovider: error performing open request to WOPI, status code: "+strconv.Itoa(openRes.StatusCode)), + Status: status.NewInvalid(ctx, fmt.Sprintf("appprovider: error performing open request to WOPI, status code: %d", openRes.StatusCode)), } return res, nil }