In this case you should use a structure like:
`if (this.error.name === 'ActivityCanceled') {
 return;
}
alert(_('attachmentOpenError'));`

This is going to work for sure! ;)