Change-Id: I9be42c909c85cd454fdd10921c8d50d6273252f8
}
$file = $args[0];
print "Loading cdb file $file...";
}
$file = $args[0];
print "Loading cdb file $file...";
- $fileHandle = CdbReader::open( $file );
+ try {
+ $fileHandle = CdbReader::open( $file );
+ } catch( CdbException $e ) {}
+
if ( !$fileHandle ) {
print "not a cdb file or unable to read it\n";
} else {
if ( !$fileHandle ) {
print "not a cdb file or unable to read it\n";
} else {
print "Need to specify a key, Luke\n";
break;
}
print "Need to specify a key, Luke\n";
break;
}
- $res = $fileHandle->get( $args[0] );
+ try {
+ $res = $fileHandle->get( $args[0] );
+ } catch ( CdbException $e ) {
+ print "Unable to read key from file\n";
+ }
if ( $res === false ) {
print "No such key/value pair\n";
} elseif ( is_string( $res ) ) {
if ( $res === false ) {
print "No such key/value pair\n";
} elseif ( is_string( $res ) ) {