MCPcopy Create free account
hub / github.com/Tripwire/tripwire-open-source / tss_dispatch_errno

Function tss_dispatch_errno

src/core/codeconvert.cpp:217–247  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

215}
216
217int tss_dispatch_errno(cDebug& d)
218{
219 // Reasons for failure:
220 // [EILSEQ] Input conv stopped due to an unknown input byte
221 // [E2BIG] Input conversion stopped due to lack of space in the output
222 // [EINVAL] Input conversion stopped due to an incomplete character
223 // [EBADF] The cd argument is not a valid open conversion descriptor.
224 // errno
225 d.TraceDebug(_T( "iconv failed with: %s\n" ), iFSServices::GetInstance()->GetErrString().c_str());
226
227 /// RAD: Always throw on error (Let user Catch if they want to go on)
228 switch (errno)
229 {
230 case EILSEQ:
231 case EINVAL:
232 throw eConverterFatal(TSS_GetString(cCore, core::STR_ERR_BADCHAR));
233 break;
234
235 case E2BIG:
236 throw eConverterFatal(TSS_GetString(cCore, core::STR_ERR_OVERFLOW));
237 break;
238
239 case EBADF:
240 throw eConverterUnknownCodepage(TSS_GetString(cCore, core::STR_UNKNOWN));
241 break;
242 default:
243 throw eConverterFatal(TSS_GetString(cCore, core::STR_UNKNOWN));
244 }
245
246 return -1;
247}
248
249template<class BufferT, class SourceT> class ByteConvert
250{

Callers 1

ConvertMethod · 0.85

Calls 3

c_strMethod · 0.80
GetErrStringMethod · 0.80
TraceDebugMethod · 0.60

Tested by

no test coverage detected