0
0
mirror of https://github.com/sveltejs/svelte.git synced 2024-12-01 17:30:59 +01:00
svelte/test/validator/samples/catch-declares-error-variable/input.svelte

14 lines
191 B
Svelte

<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)}