| … | … | @@ -22,6 +22,7 @@ |
| 22 | 22 | */ |
| 23 | 23 | |
| 24 | 24 | #include <opencog/atomspace/AtomSpace.h> |
| 25 | #include <opencog/atoms/value/VoidValue.h> |
| 25 | 26 | #include "LiteralValueOfLink.h" |
| 26 | 27 | |
| 27 | 28 | using namespace opencog; |
| … | … | @@ -45,13 +46,17 @@ ValuePtr LiteralValueOfLink::execute(AtomSpace* as, bool silent) |
| 45 | 46 | ValuePtr pap(get_literal(as, silent)); |
| 46 | 47 | if (pap) return pap; |
| 47 | 48 | |
| 49 | // If we are here, then no Value was found. If there is a |
| 50 | // third Atom, then it specifies a default to use instead. |
| 51 | if (2 < _outgoing.size()) |
| 52 | return _outgoing[2]; |
| 53 | |
| 48 | 54 | // Oh no! Nothing was found! |
| 49 | 55 | if (silent) |
| 50 | 56 | throw SilentException(); |
| 51 | 57 | |
| 52 | 58 | throw InvalidParamException(TRACE_INFO, |
| 53 | | "No value at key %s on atom %s", |
| 54 | | ak->to_string().c_str(), ah->to_string().c_str()); |
| 59 | "No value for %s", to_string().c_str()); |
| 55 | 60 | |
| 56 | 61 | return createVoidValue(); |
| 57 | 62 | } |