@@ -690,9 +690,9 @@ func TestHandler_Endpoints(t *testing.T) {
690
690
r = test .MustNewHTTPRequest ("POST" , "/index/idx1" , strings .NewReader ("" ))
691
691
h .ServeHTTP (w , r )
692
692
if w .Code != gohttp .StatusConflict {
693
- t .Fatalf ("unexpected status code: %d" , w .Code )
694
- } else if w .Body .String () != `{"success":false,"error":{"message":"index already exists"}}` + "\n " {
695
- t .Fatalf ("unexpected body: %q" , w .Body .String ())
693
+ t .Errorf ("unexpected status code: %d" , w .Code )
694
+ } else if w .Body .String () != `{"success":false,"error":{"message":"creating index: index already exists"}}` + "\n " {
695
+ t .Errorf ("unexpected body: %q" , w .Body .String ())
696
696
}
697
697
698
698
// create field
@@ -710,9 +710,9 @@ func TestHandler_Endpoints(t *testing.T) {
710
710
r = test .MustNewHTTPRequest ("POST" , "/index/idx1/field/fld1" , strings .NewReader ("" ))
711
711
h .ServeHTTP (w , r )
712
712
if w .Code != gohttp .StatusConflict {
713
- t .Fatalf ("unexpected status code: %d" , w .Code )
714
- } else if w .Body .String () != `{"success":false,"error":{"message":"field already exists"}}` + "\n " {
715
- t .Fatalf ("unexpected body: %q" , w .Body .String ())
713
+ t .Errorf ("unexpected status code: %d" , w .Code )
714
+ } else if w .Body .String () != `{"success":false,"error":{"message":"creating field: field already exists"}}` + "\n " {
715
+ t .Errorf ("unexpected body: %q" , w .Body .String ())
716
716
}
717
717
718
718
// delete field
@@ -730,9 +730,9 @@ func TestHandler_Endpoints(t *testing.T) {
730
730
r = test .MustNewHTTPRequest ("DELETE" , "/index/idx1/field/fld1" , strings .NewReader ("" ))
731
731
h .ServeHTTP (w , r )
732
732
if w .Code != gohttp .StatusNotFound {
733
- t .Fatalf ("unexpected status code: %d" , w .Code )
734
- } else if w .Body .String () != `{"success":false,"error":{"message":"field not found"}}` + "\n " {
735
- t .Fatalf ("unexpected body: %q" , w .Body .String ())
733
+ t .Errorf ("unexpected status code: %d" , w .Code )
734
+ } else if w .Body .String () != `{"success":false,"error":{"message":"deleting field: field not found"}}` + "\n " {
735
+ t .Errorf ("unexpected body: %q" , w .Body .String ())
736
736
}
737
737
738
738
// delete index
@@ -750,9 +750,9 @@ func TestHandler_Endpoints(t *testing.T) {
750
750
r = test .MustNewHTTPRequest ("DELETE" , "/index/idx1" , strings .NewReader ("" ))
751
751
h .ServeHTTP (w , r )
752
752
if w .Code != gohttp .StatusNotFound {
753
- t .Fatalf ("unexpected status code: %d" , w .Code )
754
- } else if w .Body .String () != `{"success":false,"error":{"message":"index not found"}}` + "\n " {
755
- t .Fatalf ("unexpected body: %q" , w .Body .String ())
753
+ t .Errorf ("unexpected status code: %d" , w .Code )
754
+ } else if w .Body .String () != `{"success":false,"error":{"message":"deleting index: index not found"}}` + "\n " {
755
+ t .Errorf ("unexpected body: %q" , w .Body .String ())
756
756
}
757
757
})
758
758
0 commit comments