Esempio n. 1
0
svn_error_t *
svn_error__trace(const char *file, long line, svn_error_t *err)
{
#ifndef SVN_DEBUG

  /* We shouldn't even be here, but whatever. Just return the error as-is.  */
  return err;

#else

  /* Only do the work when an error occurs.  */
  if (err)
    {
      svn_error__locate(file, line);
      return svn_error_quick_wrap(err, SVN_ERR__TRACED);
    }
  return SVN_NO_ERROR;

#endif
}
Esempio n. 2
0
svn_error_t *
svn_error_raise_on_malfunction(svn_boolean_t can_return,
                               const char *file, int line,
                               const char *expr)
{
  if (!can_return)
    abort(); /* Nothing else we can do as a library */

  /* The filename and line number of the error source needs to be set
     here because svn_error_createf() is not the macro defined in
     svn_error.h but the real function. */
  svn_error__locate(file, line);

  if (expr)
    return svn_error_createf(SVN_ERR_ASSERTION_FAIL, NULL,
                             _("In file '%s' line %d: assertion failed (%s)"),
                             file, line, expr);
  else
    return svn_error_createf(SVN_ERR_ASSERTION_FAIL, NULL,
                             _("In file '%s' line %d: internal malfunction"),
                             file, line);
}