title: Between raise Error and logging the Error, which one is a better practice in Python?
body: <p>Python tutorial have a section called Errors and Exceptions which use the structure as;</p>
  
  <pre><code>try:
      [statement]
  except [Built-in ExceptionType]:
      do something when an exception has been captured.
  finally:
      do something whether exception occurred or not.
  </code></pre>
  
  <p>This can also handle by raise an Error directly, too.</p>
  
  <pre><code>try:
      raise [Built-in ExceptionType]
  except [Built-in ExceptionType above] as e:
      print(f'foo error: {e}')
  </code></pre>
  
  <p>There are several built-in ExceptionType which the good practice is developer should catch every specific exceptions type that developer should look for. (refer from <a href="https://stackoverflow.com/questions/21553327/why-is-except-pass-a-bad-programming-practice">Why is &quot;except: pass&quot; a bad programming practice?</a>)</p>
  
  <p>However, after I reading logging section. I'm thinking about I want to log the error into the log file and let user to aware the error (maybe just print the text and user can inform IT support)  rather than throwing an exception on screen. Therefore, instead of try / except combo above then I can use the following error message and logged it.</p>
  
  <pre><code>if len(symbol) != 1:
      error_message = f'Created box with symbol={symbol}, width={width} and height={height}, Symbol needs to be a string of length 1'
      logger.error(error_message)
      print(f'\nError! symbol={symbol}, width={width} and height={height} -- Symbol needs to be a string of length 1')
      return
  </code></pre>
  
  <p>I doubt that what the better current practice is between:</p>
  
  <p>a)  raise Error on screen and</p>
  
  <p>b)  logging the Error for further investigation? </p>
  
  <p>c)  Other method (please suggest me)</p>
  
  <p>I hope that I'm not try to comparing two different things.For me, I want to choose b) and store the error in log. this is easier for investigation and does not give unnecessary information to the users. but I do not sure I'm on the right track or not. Thank you very much.</p>