I totally missed that the old code used `trigger_error`. I've converted this to an exception in 8f8425c70a17bc2b5156f36fb319726c12451321