1
0
Fork 0
freesewing/markdown/dev/reference/api/part/raise/error/en.md

36 lines
866 B
Markdown
Raw Normal View History

---
title: Part.raise.error()
---
2021-09-25 17:53:09 +02:00
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](/reference/api/part/raise/warning).
2021-09-25 17:53:09 +02:00
<Tip>
2021-09-25 17:53:09 +02:00
All raise methods are available via [the shorthand method](/reference/api/part/shorthand)
2021-09-25 17:53:09 +02:00
</Tip>
2021-09-25 17:53:09 +02:00
## Part.raise.error() signature
2021-09-25 17:53:09 +02:00
```js
raise.error(data)
```
2021-09-25 17:53:09 +02:00
## Part.raise.error() example
2021-09-25 17:53:09 +02:00
```js
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
}
}
```