Changeset 1454 for trunk


Ignore:
Timestamp:
Dec 24, 2011, 12:19:08 AM (9 years ago)
Author:
Peter Johansson
Message:

catch exception from yat and improve error message

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/SVNproperty.cc

    r1453 r1454  
    2828#include "utility.h"
    2929
     30#include "yat/Exception.h"
    3031#include "yat/Segment.h"
    3132#include "yat/utility.h"
    3233
    3334#include <limits>
     35#include <stdexcept>
     36#include <sstream>
    3437#include <string>
    3538
     
    5659  {
    5760    for ( ; i!=last ; ++i) {
    58       if (i->first == "svndigest:ignore")
    59         svndigest_ignore_=true;
    60       else if (i->first == "svncopyright:ignore") {
    61         add_svncopyright_ignore(i->second);
     61      try {
     62        if (i->first == "svndigest:ignore")
     63          svndigest_ignore_=true;
     64        else if (i->first == "svncopyright:ignore")
     65          add_svncopyright_ignore(i->second);
     66        else
     67          if ((i->first == "svn:mime-type") &&
     68              (svn_mime_type_is_binary(i->second.c_str())))
     69            binary_=true;
    6270      }
    63       else
    64         if ((i->first == "svn:mime-type") &&
    65             (svn_mime_type_is_binary(i->second.c_str())))
    66           binary_=true;
     71      catch (yat::utility::runtime_error& e) {
     72        std::ostringstream ss;
     73        ss << "invalid value for property '" << i->first << "': '"
     74           << i->second << "'";
     75        throw std::runtime_error(ss.str());
     76      }
    6777    }
    68   }
     78  }
    6979
    7080
Note: See TracChangeset for help on using the changeset viewer.