title: Return statement in Elixir
body: <p>I need a function with some kind of a step-by-step logic and I wonder how I can make one. Let's take a log in process on a site as an example, so I need the following logic: </p>
  
  <blockquote>
    <p>1) Email is present? Yes -> Go on; No -> Return an error </p>
    
    <p>2) Email has at least 5 characters? Yes -> Go on; No -> Return an error</p>
    
    <p>3) Password is present? Yes -> Go on; No - Return an error</p>
    
    <p>And so on ...</p>
  </blockquote>
  
  <p>And to implement this, I would usually use a <code>return</code> statement so that if the email is not present, I quit executing the function and make it return an error. But I can't find something similar to this in Elixir so I need an advice. The only way I can see now is to use nested conditions but maybe there is a better way?</p>