Warning: Can't synchronize with repository "(default)" (Unsupported version control system "svn": No module named svn). Look in the Trac log for more information.

Changes between Version 10 and Version 11 of HowDoesErrorHandlingWork


Ignore:
Timestamp:
02/23/06 17:56:16 (13 years ago)
Author:
simon
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • HowDoesErrorHandlingWork

    v10 v11  
    8080 }}} 
    8181 ''failsafe_values'' is ignored. 
    82  * ''!FailsafeSchema.values'': If ''failsafe_values'' is a dict, every input for which exists a key in ''failsafe_values'' is replaced with corresponding value. Otherwise all erroneous inputs are replaced with (same instance of!) ''failsafe_values''. 
     82 * ''!FailsafeSchema.values'': If ''failsafe_values'' is a dict, every erroneous input for which exists a key in ''failsafe_values'' is replaced with corresponding value. Otherwise all erroneous inputs are replaced with (same instance of!) ''failsafe_values''. 
    8383 {{{ 
    8484 @validate(validators={"bar":validators.Int(), "baz":validators.Int()}, failsafe_schema=FailsafeSchema.values, failsafe_values={"bar":1, "baz":2}) 
     
    9090 Both bar and baz are set to 13 when erroneous. 
    9191 
    92  * ''!FailsafeSchema.map_errors'': Inputs are mapped to corresponding exceptions.  
     92 * ''!FailsafeSchema.map_errors'': Erroneous inputs are mapped to corresponding exceptions.  
    9393 {{{ 
    9494 @validate(validators={"bar":validators.Int(), "baz":validators.Int()}, failsafe_schema=FailsafeSchema.map_errors) 
    9595 }}} 
     96 ''failsafe_values'' is ignored. 
     97 
     98 * ''FailsafeSchema.defaults'': Erroneous inputs are mapped to method defaults. 
     99 {{{ 
     100 @validate(validators={"bar":validators.Int(), "baz":validators.Int()}, failsafe_schema=FailsafeSchema.defaults) 
     101 def foo(self, baz=1, bar=2): 
     102    ... 
     103 }}} 
     104 If erroneous, bar is set to (int) 1, while baz to 2. 
    96105 ''failsafe_values'' is ignored. 
    97106