code: func createMarshalledReply(id, result interface{}, replyErr error) ([]byte, error) {
  	var jsonErr *btcjson.RPCError
  	if replyErr != nil {
  		if jErr, ok := replyErr.(*btcjson.RPCError); ok {
  			jsonErr = jErr
  		} else {
  			jsonErr = internalRPCError(replyErr.Error(), "")
  		}
  	}
  
  	return btcjson.MarshalResponse(id, result, jsonErr)
  }
docs: // createMarshalledReply returns a new marshalled JSON-RPC response given the
  // passed parameters.  It will automatically convert errors that are not of
  // the type *btcjson.RPCError to the appropriate type as needed.