exception.h 516 B

123456789101112131415161718192021
  1. //
  2. // exception.h
  3. // graphics
  4. //
  5. // Created by Sam Jaffe on 7/6/19.
  6. // Copyright © 2019 Sam Jaffe. All rights reserved.
  7. //
  8. #pragma once
  9. #include <stdexcept>
  10. #include <string>
  11. namespace graphics {
  12. struct file_read_error : std::runtime_error {
  13. file_read_error(std::string const & file)
  14. : std::runtime_error("Unable to read file " + file) {}
  15. file_read_error(std::string const & type, std::string const & file)
  16. : std::runtime_error("Unable to read " + type + " file " + file) {}
  17. };
  18. }