diff options
author | Zdenek Prikryl <zdeny@dhcp-lab-218.englab.brq.redhat.com> | 2009-04-28 17:08:09 +0200 |
---|---|---|
committer | Zdenek Prikryl <zdeny@dhcp-lab-218.englab.brq.redhat.com> | 2009-04-28 17:08:09 +0200 |
commit | 2e6a6e8aed825e456600d01c8a805b6f6fd24c3a (patch) | |
tree | c58cba2913350fed9674813b3fe0a27e6639fbd2 /src/Hooks/CCpp.cpp | |
parent | b08d5c2cf630ecb89d2f22b985dcdfcf25494258 (diff) | |
download | abrt-2e6a6e8aed825e456600d01c8a805b6f6fd24c3a.tar.gz abrt-2e6a6e8aed825e456600d01c8a805b6f6fd24c3a.tar.xz abrt-2e6a6e8aed825e456600d01c8a805b6f6fd24c3a.zip |
new commlayerinner interface
Diffstat (limited to 'src/Hooks/CCpp.cpp')
-rw-r--r-- | src/Hooks/CCpp.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/Hooks/CCpp.cpp b/src/Hooks/CCpp.cpp index 646beaff..05e0b568 100644 --- a/src/Hooks/CCpp.cpp +++ b/src/Hooks/CCpp.cpp @@ -20,6 +20,7 @@ */ #include "DebugDump.h" +#include "ABRTException.h" #include <stdlib.h> #include <string.h> #include <limits.h> @@ -132,7 +133,7 @@ int main(int argc, char** argv) { free(executable); free(cmdline); - throw std::string("Can not get proc info."); + throw CABRTException(EXCEP_FATAL, "Can not get proc info."); } snprintf(path, sizeof(path), "%s/ccpp-%ld-%s", dddir, time(NULL), pid); @@ -148,7 +149,7 @@ int main(int argc, char** argv) { dd.Delete(); dd.Close(); - throw std::string("Can not open the file ") + path; + throw CABRTException(EXCEP_FATAL, std::string("Can not open the file ") + path); } // TODO: rewrite this while ((byte = getc(stdin)) != EOF) @@ -158,7 +159,7 @@ int main(int argc, char** argv) fclose(fp); dd.Delete(); dd.Close(); - throw std::string("Can not write to the file %s."); + throw CABRTException(EXCEP_FATAL, "Can not write to the file %s."); } } @@ -168,10 +169,10 @@ int main(int argc, char** argv) dd.Close(); write_success_log(pid); } - catch (std::string sError) + catch (std::exception& e) { - fprintf(stderr, "%s: %s\n", program_name, sError.c_str()); - write_faliure_log(sError.c_str()); + fprintf(stderr, "%s: %s\n", program_name, e.what()); + write_faliure_log(e.what()); return -2; } return 0; |