Skip to content

Commit

Permalink
Move sendException method
Browse files Browse the repository at this point in the history
Summary: Fewer files.

Reviewed By: leoleovich

Differential Revision: D69479768

fbshipit-source-id: 346c8161f397e1cf634a60983244ee17bf0ec646
  • Loading branch information
echistyakov authored and facebook-github-bot committed Feb 12, 2025
1 parent c5af642 commit 9d369ab
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 36 deletions.
36 changes: 0 additions & 36 deletions third-party/thrift/src/thrift/lib/go/thrift/exception.go

This file was deleted.

15 changes: 15 additions & 0 deletions third-party/thrift/src/thrift/lib/go/thrift/processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,21 @@ func setRequestHeadersForResult(protocol types.Protocol, result types.WritableSt
}
}

// sendException is a utility function to send the exception for the specified
// method.
func sendException(prot types.Encoder, name string, seqID int32, err types.ApplicationException) error {
if e2 := prot.WriteMessageBegin(name, types.EXCEPTION, seqID); e2 != nil {
return e2
} else if e2 := err.Write(prot); e2 != nil {
return e2
} else if e2 := prot.WriteMessageEnd(); e2 != nil {
return e2
} else if e2 := prot.Flush(); e2 != nil {
return e2
}
return nil
}

// process is a utility function to take a processor and a protocol, and fully process a message.
// It is broken up into 3 steps:
// 1. Read the message from the protocol.
Expand Down

0 comments on commit 9d369ab

Please sign in to comment.