Better types for WebAPI

This commit is contained in:
Fedor Indutny 2021-09-21 17:58:03 -07:00 committed by GitHub
parent c05d23e628
commit b9d6497cb1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
22 changed files with 156 additions and 107 deletions

View file

@ -8,6 +8,7 @@ import { action } from '@storybook/addon-actions';
import { times } from 'lodash';
import { setupI18n } from '../../../util/setupI18n';
import { CapabilityError } from '../../../types/errors';
import enMessages from '../../../../_locales/en/messages.json';
import { ConversationDetails, Props } from './ConversationDetails';
import { ConversationType } from '../../../state/ducks/conversations';
@ -152,9 +153,7 @@ story.add('Group add with missing capabilities', () => (
{...createProps()}
canEditGroupInfo
addMembers={async () => {
const error = new Error();
error.code = 'E_NO_CAPABILITY';
throw error;
throw new CapabilityError('stories');
}}
/>
));