add try catch to all functions on struct mapistore_backend
use execinfo.h to get backtrace

Really poor backtrace because it will only have the frames from oc side,
I don't know why callStackSymbols is returning null, compilation flags?
oc-sogo: try/catch to guard only the actual impelementation rather than *everything*

Signed-off-by: Kamen Mazdrashki <kmazdrashki@zentyal.com>
oc-sogo: Clean up AutoRelease pool and unregister threads in Catch handler

Most of the time we have "not yet implemented" kind of exceptions,
so it is better to clean up allocated resources

Signed-off-by: Kamen Mazdrashki <kmazdrashki@zentyal.com>
oc-sogo: Use [e name] and [e reason] selectors

Signed-off-by: Kamen Mazdrashki <kmazdrashki@zentyal.com>
oc-sogo: Move memory clean up *after* handling the exception

Otherwise the mess is full :)

Signed-off-by: Kamen Mazdrashki <kmazdrashki@zentyal.com>
oc-sogo: Print both [NSException callStackSymbols] and execinfo.h stack trace

Signed-off-by: Kamen Mazdrashki <kmazdrashki@zentyal.com>
oc-sogo: pretty print Exceptions in sogo_backend_handle_objc_exception()

Now we have a nice stack trace printed out from [NSException callStackSymbols]

Signed-off-by: Kamen Mazdrashki <kmazdrashki@zentyal.com>
Merge pull request #7 from Zentyal/kamenim/exception-handling-oc-mapistore-backend-functions

exception handling oc mapistore backend functions