title: custom exceptions when rescued gives a name error?
body: <p>I am trying to raise myExceptions in a service in rails.</p>
  
  <p>But when i rescue with specific name of exception it gives me a nameError for the exception called.</p>
  
  <pre><code>status": 500,
  "error": "Internal Server Error",
  "exception": "#&lt;NameError: uninitialized constant Api::V1::UsersController::CustomExceptions&gt;",
  "traces": {
  </code></pre>
  
  <p><strong>Exceptions File:</strong></p>
  
  <pre><code>module CustomExceptions
    class EmptyObject &lt; StandardError; end
    class WrongParams &lt; StandardError; end
    class Unauthorized &lt; StandardError; end
  end
  </code></pre>
  
  <p><strong>Exception Raised:</strong> </p>
  
  <pre><code>class UsersService
  class &lt;&lt; self
      include AuthenticationHelper
      def find_users(current_user, query_params)          
          users = User.where(some query)
          if users.count &gt; 0
              users
          else
              raise CustomExceptions::EmptyObject, "empty user object returned"
          end
      end
  end
  end
  </code></pre>
  
  <p><strong>rescue in controller:</strong></p>
  
  <pre><code> rescue CustomExceptions::EmptyObject =&gt; error
    render json: {error: 'No users found'}, status: 404
  end
  </code></pre>