MCPcopy Create free account
hub / github.com/arrayfire/forge / processException

Function processException

src/backend/common/err_common.cpp:90–126  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

88}
89
90fg_err processException()
91{
92 stringstream ss;
93 fg_err err= FG_ERR_INTERNAL;
94
95 try {
96 throw;
97 } catch (const TypeError &ex) {
98 ss << "In function " << ex.getFunctionName() << "\n"
99 << "In file " << ex.getFileName() << ":" << ex.getLineNumber() << "\n"
100 << "Invalid type for argument " << ex.getArgIndex() << "\n"
101 << "Expects the type : "<< ex.getTypeName() << "\n";
102
103 print_error(ss.str());
104 err = FG_ERR_INVALID_TYPE;
105 } catch (const ArgumentError &ex) {
106 ss << "In function " << ex.getFunctionName() << "\n"
107 << "In file " << ex.getFileName() << ":" << ex.getLineNumber() << "\n"
108 << "Invalid argument at index " << ex.getArgIndex() << "\n"
109 << "Expected : "<< ex.getExpectedCondition() << "\n";
110
111 print_error(ss.str());
112 err = FG_ERR_INVALID_ARG;
113 } catch (const FgError &ex) {
114 ss << "In function " << ex.getFunctionName() << "\n"
115 << "In file " << ex.getFileName() << ":" << ex.getLineNumber() << "\n"
116 << ex.what() << "\n";
117
118 print_error(ss.str());
119 err = ex.getError();
120 } catch (...) {
121 print_error(ss.str());
122 err = FG_ERR_UNKNOWN;
123 }
124
125 return err;
126}
127
128const char * getName(forge::dtype type)
129{

Callers

nothing calls this directly

Calls 4

print_errorFunction · 0.85
getLineNumberMethod · 0.80
getErrorMethod · 0.80
getArgIndexMethod · 0.45

Tested by

no test coverage detected