Browse Source

merged two err catchers

deiu 5 years ago
parent
commit
2c39f9024b
2 changed files with 0 additions and 5 deletions
  1. 0 3
      server.go
  2. 0 2
      server_test.go

+ 0 - 3
server.go

@@ -850,9 +850,6 @@ func (s *Server) handle(w http.ResponseWriter, req *httpRequest) (r *response) {
 			err = g.WriteFile(f, "text/turtle")
 			if err != nil {
 				s.debug.Println("PATCH g.WriteFile err: " + err.Error())
-			}
-
-			if err != nil {
 				return r.respond(500, err)
 			}
 			s.debug.Println("Succefully PATCHed resource", resource.URI)

+ 0 - 2
server_test.go

@@ -777,8 +777,6 @@ func TestPATCHSPARQL(t *testing.T) {
 	g := NewGraph(testServer.URL + "/_test/abc")
 	g.LoadURI(testServer.URL + "/_test/abc")
 	assert.NotNil(t, g.One(NewResource("http://a.com"), NewResource("http://b.com"), NewResource("http://c.com")))
-	s, err := g.Serialize("text/turtle")
-	assert.NoError(t, err)
 
 	sparqlData = `DELETE DATA { <http://a.com> <http://b.com> <http://c.com>  . }; DELETE DATA { <http://a.com> <http://b.com> "123"^^<http://www.w3.org/2001/XMLSchema#int> . }`
 	request, err = http.NewRequest("PATCH", testServer.URL+"/_test/abc", strings.NewReader(sparqlData))