Created
March 28, 2016 17:06
-
-
Save davisp/708f08e5235e44f427e6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| all: compile | |
| compile: | |
| c++ -std=c++11 -I/usr/local/include -L/usr/local/lib -ltks -ltsp -o toadtest toadtest.cc | |
| run: | |
| ./toadtest | |
| destroy: | |
| /home/davisp/build/bin/cleantoaddisk all |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdio.h> | |
| #include <tks.h> | |
| #include <tks_iterator.h> | |
| #include <tks_exception.h> | |
| int | |
| main(int argc, char* argv[]) | |
| { | |
| toad::access a; | |
| toad::access b; | |
| try { | |
| a.shard_create("foo"); | |
| } catch(toad::error::null_pointer &e) { | |
| fprintf(stderr, "NULL pointer for create shard\n"); | |
| } catch(toad::error::prep_container_create &e) { | |
| fprintf(stderr, "prep_container_create\n"); | |
| } catch(toad::error::container_create &e) { | |
| fprintf(stderr, "container_create\n"); | |
| } catch(std::exception &e) { | |
| fprintf(stderr, "STD: %s\n", e.what()); | |
| } catch(...) { | |
| fprintf(stderr, "unknown error\n"); | |
| } | |
| try { | |
| b.shard_create("foo"); | |
| } catch(toad::error::null_pointer &e) { | |
| fprintf(stderr, "NULL pointer for create shard\n"); | |
| } catch(toad::error::prep_container_create &e) { | |
| fprintf(stderr, "prep_container_create\n"); | |
| } catch(toad::error::container_create &e) { | |
| fprintf(stderr, "container_create\n"); | |
| } catch(std::exception &e) { | |
| fprintf(stderr, "STD: %s\n", e.what()); | |
| } catch(...) { | |
| fprintf(stderr, "unknown error\n"); | |
| } | |
| fprintf(stderr, "Created shard \"foo\"\n"); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment