SHARE
TWEET

Untitled

a guest Feb 16th, 2018 114 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. note
  2.     description: "Summary description for {ETF_ERROR_MESSAGE}."
  3.     author: ""
  4.     date: "$Date$"
  5.     revision: "$Revision$"
  6.  
  7. class
  8.     ETF_ERROR_MESSAGE
  9.  
  10. create
  11.     make
  12.  
  13. feature {NONE} -- Initialization
  14.  
  15.     make
  16.         local
  17.             output_setter : ETF_CMD_LINE_OUTPUT_HANDLER
  18.             reg_setter : ETF_MODEL_ACCESS
  19.         do
  20.             create output_setter.make
  21.             output_handler := output_setter
  22.             reg := reg_setter.m
  23.         end
  24.  
  25. feature {ETF_COMMAND, ETF_PUT} -- error conditions
  26.  
  27.     err : STRING
  28.         attribute create Result.make_empty end
  29.  
  30.     err_nonpositive_id : STRING
  31.         attribute Result := "id must be positive" end
  32.  
  33.     err_unused_id : STRING
  34.         attribute Result := "id not identified with a person in database" end
  35.  
  36.     err_same_id : STRING
  37.         attribute Result := "ids must be different" end
  38.  
  39.     err_id_alreadytaken : STRING
  40.         attribute Result := "id already taken" end
  41.  
  42.     err_start_name : STRING
  43.         attribute Result := "name must start with A-Z or a-z" end
  44.  
  45.     err_start_country : STRING
  46.         attribute Result := "country must start with A-Z or a-Z" end
  47.  
  48.     err_date_invalid : STRING
  49.         attribute Result := "not a valid date in 1900..3000" end
  50.  
  51.     err_cant_marry : STRING
  52.         attribute Result := "proposed marriage invalid" end
  53.  
  54.     err_divorced : STRING
  55.         attribute Result := "these are not married" end
  56.  
  57.     err_already_dead : STRING
  58.         attribute Result := "person with that id already dead" end
  59.  
  60.     set_err (err_string : STRING)
  61.         do
  62.             err := err_string
  63.             err_out (err)
  64.         end
  65.  
  66.     err_out (send_err : STRING)
  67.         do
  68.             reg.update_model_error(send_err)
  69.         end
  70.  
  71. feature --{NONE}
  72.     output_handler : ETF_CMD_LINE_OUTPUT_HANDLER
  73.     reg : ETF_MODEL
  74.  
  75. end
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top