From 4c9fdaf952cfcf91e9b008c3c5d2566aa28790fb Mon Sep 17 00:00:00 2001 From: dakkar Date: Mon, 25 Dec 2017 10:03:38 +0000 Subject: some very awkawrd error handling --- lib/Ultramarine/Model/Collection.pm6 | 3 +++ lib/Ultramarine/Model/DirScanner.pm6 | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/Ultramarine/Model/Collection.pm6 b/lib/Ultramarine/Model/Collection.pm6 index c8cddf7..449e7ed 100644 --- a/lib/Ultramarine/Model/Collection.pm6 +++ b/lib/Ultramarine/Model/Collection.pm6 @@ -16,6 +16,9 @@ class Ultramarine::Model::Collection { has $!mark-ready = $!is-ready.vow; method update() { + # I don't know what to do when things go wrong, let's "log" + # it, at least + CATCH { default { .perl.say } } react whenever $.dirscan.scan -> $path { when $path ~~ Ultramarine::Model::DirScanner::EndOfScan { # we should use this to check that all the files in diff --git a/lib/Ultramarine/Model/DirScanner.pm6 b/lib/Ultramarine/Model/DirScanner.pm6 index e5dcfbf..7ce249b 100644 --- a/lib/Ultramarine/Model/DirScanner.pm6 +++ b/lib/Ultramarine/Model/DirScanner.pm6 @@ -25,10 +25,10 @@ class Ultramarine::Model::DirScanner { } } - start { + (start { inner-scan($.root); $ret.emit(EndOfScan); - } + }).then(-> $p { $ret.quit($p.cause) if $p.status ~~ Broken }); CATCH { $ret.quit($_) }; return $ret.Supply; -- cgit v1.2.3