Skip to content

Commit 5901d77

Browse files
authored
Add hook for failed route calculation
Added a hook call for failed route calculations to provide additional context.
1 parent 924cfc5 commit 5901d77

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/Task/CalcMapRoute.pm

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,14 @@ sub iterate {
233233
$self->{source}{field}->baseName, $self->{source}{x}, $self->{source}{y},
234234
$self->{targets}[0]->{map} || T("unknown"), $destpos));
235235
debug "CalcMapRoute failed.\n", "calc_map_route";
236+
Plugins::callHook('fail_calc_map_route', {
237+
map_from => $self->{source}{field}->baseName,
238+
map_from_x => $self->{source}{x},
239+
map_from_y => $self->{source}{y},
240+
map_to => $self->{targets}[0]->{map},
241+
map_to_x => $self->{targets}[0]->{x} ? $self->{targets}[0]->{x} : undef,
242+
map_to_y => $self->{targets}[0]->{y} ? $self->{targets}[0]->{y} : undef
243+
});
236244
}
237245
}
238246
}

0 commit comments

Comments
 (0)