cmd/target: use variable instead of type for representing error