Switch branches/tags
Nothing to show
Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
..
Failed to load latest commit information.
post-images
1. Base scenario – Error codes & switch statement.php
2. Replace Magic Number with Symbolic Constant.php
3. Replace Error Code with Exception.php
3.1. Propagate other kinds of exceptions.php
4. Create specific RuntimeException child classes - class diagram.png
4. Create specific RuntimeException child classes.php
5. Create an intermediate abstract Exception class - class diagram.png
5. Create an intermediate abstract Exception class.php
5.1. Encapsulating the login validation - class diagram.png
5.1. Encapsulating the login validation.php
README.md

README.md

Why throwing exceptions is better than returning error codes

Blog post information

  • Title: Why throwing exceptions is better than returning error codes
  • Main purpose: Illustrate the benefits to use exceptions rather than returning error codes. Furthermore, go one step ahead and use an approach that helps out to illustrate this process by examples of Code Smells and Refactorings towards a happy SOLID end :)
  • URL: http://javierferrer.me/exceptions-vs-error-codes/
  • Date: 2015-02-02
  • Categories: Development
  • Tags: Clean Code, Code smells, Refactoring, Software Design Patterns, SOLID
  • Author: Ferrer González, Javier

Return error code vs throw Exception

Pokémon exception handling