260Discretionary custodial sentences: general restrictions
(1)This section applies where a court is dealing with an offender for a service offence punishable with a custodial sentence, other than an offence the sentence for which—
(a)is fixed by law; or
(b)falls to be imposed as a result of subsection (2) of any of sections 219 to 222 and 225 to 227.
(2)The court must not pass a custodial sentence unless it is of the opinion that the offence, or the combination of the offence and one or more offences associated with it, was so serious that no less severe sentence can be justified for the offence.
(3)Nothing in subsection (2) prevents the court from passing a custodial sentence where—
(a)the court had proposed to award a community punishment; and
(b)the offender failed to express his willingness to comply with a requirement which the court proposed to include in the community punishment and which required an expression of such willingness.
(4)In forming any such opinion as is mentioned in subsection (2) or section 261(2) (length of sentence), a court must take into account all such information as is available to it about the circumstances of the offence and any associated offence, including any aggravating or mitigating factors.
(5)For the purposes of this section a sentence falls to be imposed as a result of subsection (2) of section 225, 226 or 227 if it is required by that subsection and the court is not of the opinion there mentioned.