Skip to content

Commit

Permalink
Fix PerspectiveCamera missing id message
Browse files Browse the repository at this point in the history
+ change to Error only (also for `OrthographicCamera`)
  • Loading branch information
Vatroslav Vrbanic committed Jun 16, 2022
1 parent 2730397 commit d986052
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
6 changes: 2 additions & 4 deletions src/components/OrthographicCamera.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,9 @@ If you use this approach you'll see a warning in the console if you define left,
export let id: string = undefined
if (!id) {
console.warn(
"SVELTHREE > OrthographicCamera : you have to provide an 'id' prop (not empty String) for Cameras in order to assign them to a 'WebGLRenderer' component!",
{ id: id }
throw new Error(
"SVELTHREE > OrthographicCamera : you have to provide an 'id' prop (not empty String) for Cameras in order to assign them to a 'WebGLRenderer' component!"
)
throw new Error("SVELTHREE Exception (see warning above)")
}
let scene: Scene = getContext("scene")
Expand Down
6 changes: 2 additions & 4 deletions src/components/PerspectiveCamera.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,9 @@ svelthree uses svelte-accmod, where accessors are always `true`, regardless of `
export let id: string = undefined
if (!id) {
console.warn(
"SVELTHREE > OrthographicCamera : you have to provide an 'id' prop (not empty String) for Cameras in order to assign them to a 'WebGLRenderer' component!",
{ id: id }
throw new Error(
"SVELTHREE > PerspectiveCamera : you have to provide an 'id' prop (not empty String) for Cameras in order to assign them to a 'WebGLRenderer' component!"
)
throw new Error("SVELTHREE Exception (see warning above)")
}
let scene: Scene = getContext("scene")
Expand Down

0 comments on commit d986052

Please sign in to comment.