text: /**
   * except.hpp - Vitreous Engine [renderer]
   * ===------------------------------------------------------------------===
   * 
   * Copyright (c) 2021 Ajay Sreedhar
   * 
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *    http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   * 
   * ===------------------------------------------------------------------===
   * 
   * Includes definition for RendererError exception which is the standard
   * runtime error thrown by all members in renderer module, upon error.
   * 
   * ===------------------------------------------------------------------===
   */
  
  #ifndef VTRS_RENDERER_EXCEPT_H
  #define VTRS_RENDERER_EXCEPT_H
  
  #include <string>
  #include <stdexcept>
  
  namespace vtrs {
  
  class RendererError: public std::runtime_error {
  
      private: // ===--- Private members
      int code = 0;
  
      public: // ===--- Public members
      enum ErrorCodes : int {
          VULKAN_INSTANCE_FAILED = 1,
          DISPLAY_NO_COMPOSITOR,
          DISPLAY_SURFACE_FAILED,
          SHELL_SURFACE_FAILED
      };
  
      /**
       * Defines a renderer exception.
       *
       * @param message the error message
       * @param code the error code, defaults to 0
       */
      RendererError(const std::string& message, int code);
  
      /**
       * Returns the exception code.
       *
       * @return the exception code
      */
      int getCode();
  };
  
  } // namespace vtrs
  
  #endif // ifndef VTRS_RENDERER_EXCEPT_H
  