]> git.tdb.fi Git - libs/core.git/blobdiff - source/io/memory.cpp
Add new exception classes for some common errors
[libs/core.git] / source / io / memory.cpp
index 0b2d8f4c1b7f49ec7ccb93222d2bf48915abf3fd..19629c446d6c8bfc5e25288e8580deeadbe68c5c 100644 (file)
@@ -1,5 +1,6 @@
 #include <algorithm>
 #include <cstring>
+#include <msp/core/except.h>
 #include "handle.h"
 #include "memory.h"
 
@@ -18,12 +19,12 @@ Memory::Memory(char *b, char *e, Mode m)
 
 void Memory::set_block(bool)
 {
-       throw logic_error("Memory::set_block");
+       throw unsupported("Memory::set_block");
 }
 
 void Memory::set_inherit(bool)
 {
-       throw logic_error("Memory::set_inherit");
+       throw unsupported("Memory::set_inherit");
 }
 
 size_t Memory::do_write(const char *buf, size_t size)
@@ -94,7 +95,7 @@ int Memory::get()
 
 const Handle &Memory::get_handle(Mode)
 {
-       throw logic_error("Memory::get_handle");
+       throw unsupported("Memory::get_handle");
 }
 
 SeekOffset Memory::seek(SeekOffset off, SeekType type)