0x4a52466c696e74 1 year ago
parent
commit
5243c332d5
2 changed files with 7 additions and 0 deletions
  1. 1 0
      example/user.go
  2. 6 0
      rest_http/request_out.go

+ 1 - 0
example/user.go

@@ -69,6 +69,7 @@ func (s *ExampleRequestRegister) Validate(req rest.IRequestIn) rest.IRequestOut
 }
 
 func (s *ExampleRequestRegister) Execute(req rest.IRequestIn) rest.IRequestOut {
+	return req.OutError(rest.ErrorMessage("!!!", "..."))
 	// создаем нового юзера
 	userID := App.GenerateID()
 	user := &ExampleUser{

+ 6 - 0
rest_http/request_out.go

@@ -23,6 +23,12 @@ type RequestOut struct {
 	rest.IRequest
 }
 
+func (s *RequestOut) RClose() {
+	if s.IRequest != nil {
+		s.IRequest.RClose()
+	}
+}
+
 // Send отправляет запрос серверу
 func (s *RequestOut) Write(writer io.Writer) rest.IErrorArgs {
 	w := writer.(http.ResponseWriter)