1
0
Fork 0
freesewing/markdown/dev/reference/api/part/raise/error/en.md
2021-10-17 18:26:00 +02:00

866 B

title
Part.raise.error()

A part's raise.error() method will log a error-level event. Unlike other raised events which have no side-effects, if there is one or more events of type error, the pattern will not be completed. In other words, you should only use this when end up in a situation you cannot recover from. If not, raise a warning.

All raise methods are available via the shorthand method

Part.raise.error() signature

raise.error(data)

Part.raise.error() example

export default function (part) {
  const { raise, measurements } = part.shorthand()

  if (measurements.hips > measurements.chest) {
    raise.warning('Chest circumference smaller than hip circumference is currently unsupported. Aborting.')
    return part
  } 
}