Files
blockly/core/icons/exceptions.ts
Beka Westberg 8b0c40bb1b feat: add implementations for adding, removing, and getting icons (#7059)
* feat: add implementations for adding, removing, and getting icons

* chore: fix tests

* chore: switch order of adding icons

* chore: create duplicate icon error

* chore: un-only test
2023-05-11 15:48:01 -07:00

21 lines
456 B
TypeScript

/**
* @license
* Copyright 2023 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import type {IIcon} from '../interfaces/i_icon.js';
export class DuplicateIconType extends Error {
/**
* @internal
*/
constructor(public icon: IIcon) {
super(
`Tried to append an icon of type ${icon.getType()} when an icon of ` +
`that type already exists on the block. ` +
`Use getIcon to access the existing icon.`
);
}
}