Skip to content
Snippets Groups Projects
Select Git revision
  • 36f238ed6a8bf55e996d57ce0f53f7f0520c7188
  • master default protected
  • vertical_relations
  • lu_without_semantic_frames
  • hierarchy
  • additional-unification-filters
  • v0.1.1
  • v0.1.0
  • v0.0.9
  • v0.0.8
  • v0.0.7
  • v0.0.6
  • v0.0.5
  • v0.0.4
  • v0.0.3
  • v0.0.2
  • v0.0.1
17 results

tests.py

Blame
  • exception.cpp 1.07 KiB
    #include <libwccl/exception.h>
    #include <sstream>
    
    namespace Wccl {
    
    WcclError::WcclError(const std::string &what)
     : PwrNlp::PwrNlpError(what)
    {
    }
    
    WcclError::~WcclError() throw()
    {
    }
    
    std::string WcclError::scope() const
    {
    	return "Wccl";
    }
    
    FileNotFound::FileNotFound(const std::string& filename,
    		const std::string& paths, const std::string& where)
    	: WcclError("File not found: " + filename), filename(filename),
    	paths(paths), where(where)
    {
    }
    
    FileNotFound::~FileNotFound() throw()
    {
    }
    
    std::string FileNotFound::info() const
    {
    	std::ostringstream ss;
    	if (where.empty()) {
    		ss << "File ";
    	} else {
    		ss << where << " file ";
    	}
    	ss << "'" << filename << "' not found in search path " << paths;
    	return ss.str();
    }
    
    InvalidArgument::InvalidArgument(const std::string &arg_name, const std::string &reason)
    	: WcclError(reason),
    	  arg_name(arg_name),
    	  reason(reason)
    {
    }
    
    InvalidArgument::~InvalidArgument() throw()
    {
    }
    
    std::string InvalidArgument::info() const
    {
    	std::ostringstream ss;
    	ss << "Invalid argument " << arg_name << " : " << reason;
    	return ss.str();
    }
    
    } /* end ns Wccl */