Uploaded image for project: 'Thrift'
  1. Thrift
  2. THRIFT-2342

Add __FILE__ and __LINE__ to Thrift C++ excpetions

    XMLWordPrintableJSON

Details

    Description

      Thrift exceptions are somewhat difficult to trace from debug logs. I'd like to add _FILEANDLINE_ as a second parameter to some exceptions to make them easier to find.

      For example:

      Every time a required field is not set, the exception that gets generated is a very generic
      throw TProtocolException(TProtocolException::INVALID_DATA)

      see - https://git-wip-us.apache.org/repos/asf?p=thrift.git;a=blob;f=compiler/cpp/src/generate/t_cpp_generator.cc;h=298096d3265baa1f008501eb7c26bb4ae96ffa4b;hb=HEAD#l1372

      I think I'll start with patching up TProtocolExcpetion in the compiler and if people like this I can make a separate issue and patch for other exceptions

      Attachments

        Issue Links

          Activity

            People

              jking3 James E. King III
              ggodik George Godik
              Votes:
              1 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: