You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
svelte/test/validator/samples/catch-declares-error-variable/input.svelte

14 lines
191 B

<script>
let value = null;
</script>
<button on:click={event => {
try {
throw new Error('foo');
} catch (error) {
value = error;
}
}}>Click to create error</button>
{String(value)}