s4-ldb: allow modules to override error return values