<commit_before>#!/usr/bin/ruby
# 
# This file contains a collection of exception classes for the Arrow web
# application framework.
# 
# == Synopsis
# 
#   
# 
# == Subversion Id
#
#  $Id$
# 
# == Authors
# 
# * <NAME> <<EMAIL>>
# 
#:include: COPYRIGHT
#
#---
#
# Please see the file docs/COPYRIGHT for licensing details.
#

module Arrow

	### Base exception class
	class Exception < StandardError
		Message = "Arrow framework error"

		def initialize( message=nil )
			message ||= self.class.const_get( "Message" )
			super( message )
		end
	end

	### Define an exception class with the specified <tt>name</tt> (a Symbol)
	### with the specified <tt>message</tt>. The new exception class will
	### inherit from the specified <tt>superclass</tt>, if specified, or
	### <tt>StandardError</tt> if not specified.
	def Arrow::def_exception( name, message, superclass=Arrow::Exception )
		name = name.id2name if name.kind_of?( Fixnum )
		eClass = Class.new( superclass )
		eClass.module_eval %Q{
			def initialize( *args )
				if ! args.empty?
					msg = args.collect {|a| a.to_s}.join
					super( msg )
				else
					super( message )
				end					
			end
		}

		const_set( name, eClass )
	end


	# System exceptions
	def_exception :ConfigError,				"Configuration error"
	def_exception :LockingError,			"Locking error"
	def_exception :FactoryError,			"Error in factory class"
	def_exception :SessionError,			"Error in session"

	# Templating errors
	def_exception :TemplateError,			"Error in templating system"<commit_msg>- Removed the FactoryError exception class to fix a bug in the templating system.<commit_after>#!/usr/bin/ruby
# 
# This file contains a collection of exception classes for the Arrow web
# application framework.
# 
# == Synopsis
# 
#   
# 
# == Subversion Id
#
#  $Id$
# 
# == Authors
# 
# * <NAME> <<EMAIL>>
# 
#:include: COPYRIGHT
#
#---
#
# Please see the file docs/COPYRIGHT for licensing details.
#

module Arrow

	### Base exception class
	class Exception < StandardError
		Message = "Arrow framework error"

		def initialize( message=nil )
			message ||= self.class.const_get( "Message" )
			super( message )
		end
	end

	### Define an exception class with the specified <tt>name</tt> (a Symbol)
	### with the specified <tt>message</tt>. The new exception class will
	### inherit from the specified <tt>superclass</tt>, if specified, or
	### <tt>StandardError</tt> if not specified.
	def Arrow::def_exception( name, message, superclass=Arrow::Exception )
		name = name.id2name if name.kind_of?( Fixnum )
		eClass = Class.new( superclass )
		eClass.module_eval %Q{
			def initialize( *args )
				if ! args.empty?
					msg = args.collect {|a| a.to_s}.join
					super( msg )
				else
					super( message )
				end					
			end
		}

		const_set( name, eClass )
	end


	# System exceptions
	def_exception :ConfigError,				"Configuration error"
	def_exception :LockingError,			"Locking error"
	def_exception :SessionError,			"Error in session"

	# Templating errors
	def_exception :TemplateError,			"Error in templating system"
{'fraction_non_alphanumeric': 0.11633256654617154, 'fraction_numerical': 0.0006572461386789353, 'mean_word_length': 3.5774436090225565, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 25, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2229862', 'n_tokens_mistral': 1097, 'n_tokens_neox': 979, 'n_words': 304}