diff options
| author | 2023-08-02 17:21:46 +0200 | |
|---|---|---|
| committer | 2023-08-02 17:21:46 +0200 | |
| commit | e8a20f587c0b0129bc68f5c6092c54f2b4c3519a (patch) | |
| tree | 3677b4abec2cabf3b5042115ba76505daf5fddf3 /internal/api/activitypub | |
| parent | [bugfix] fix slow accounts / statuses using emojis lookups (#2056) (diff) | |
| download | gotosocial-e8a20f587c0b0129bc68f5c6092c54f2b4c3519a.tar.xz | |
[bugfix] Rework MultiError to wrap + unwrap errors properly (#2057)
* rework multierror a bit
* test multierror
Diffstat (limited to 'internal/api/activitypub')
| -rw-r--r-- | internal/api/activitypub/users/inboxpost_test.go | 7 | 
1 files changed, 3 insertions, 4 deletions
diff --git a/internal/api/activitypub/users/inboxpost_test.go b/internal/api/activitypub/users/inboxpost_test.go index c5027f342..d26dae513 100644 --- a/internal/api/activitypub/users/inboxpost_test.go +++ b/internal/api/activitypub/users/inboxpost_test.go @@ -22,7 +22,6 @@ import (  	"context"  	"encoding/json"  	"errors" -	"fmt"  	"io"  	"net/http"  	"net/http/httptest" @@ -105,16 +104,16 @@ func (suite *InboxPostTestSuite) inboxPost(  		suite.FailNow(err.Error())  	} -	errs := gtserror.MultiError{} +	errs := gtserror.NewMultiError(2)  	// Check expected code + body.  	if resultCode := recorder.Code; expectedHTTPStatus != resultCode { -		errs = append(errs, fmt.Sprintf("expected %d got %d", expectedHTTPStatus, resultCode)) +		errs.Appendf("expected %d got %d", expectedHTTPStatus, resultCode)  	}  	// If we got an expected body, return early.  	if expectedBody != "" && string(b) != expectedBody { -		errs = append(errs, fmt.Sprintf("expected %s got %s", expectedBody, string(b))) +		errs.Appendf("expected %s got %s", expectedBody, string(b))  	}  	if err := errs.Combine(); err != nil {  | 
