Permalink
Browse files

Better error messages

Signed-off-by: Niels van Hoorn <nvh@nvh.io>
  • Loading branch information...
nvh committed Sep 14, 2016
1 parent 32ac81b commit eac0aa85e9d29349fd5e058ba7c65d4b04d26f5f
Showing with 3 additions and 3 deletions.
  1. +3 −3 framer/LayerStates.coffee
@@ -21,17 +21,17 @@ deprecatedProperty = (object, name, replacementSuggestion, stateMachine, getter,
get: ->
if stateMachine.properties[name]?
return stateMachine.properties[name]
message = "states.#{name} is deprecated"
message = "layer.states.#{name} is deprecated"
if replacementSuggestion?
message += ", use '#{replacementSuggestion}' instead."
console.warn message
getter(stateMachine._layer)
set: (value) ->
if setter?
console.warn "states.#{name} a reserved state name and might not work as expected."
console.warn "layer.states.#{name} a reserved state name and might not work as expected."
setter(stateMachine._layer, value)
else
console.warn "states.#{name} is a deprecated method, using it as a state name may cause unexpected behaviour in old projects."
console.warn "layer.states.#{name} is a deprecated method, using it as a state name may cause unexpected behaviour in old projects."
stateMachine.properties[name] = value
class exports.LayerStates

0 comments on commit eac0aa8

Please sign in to comment.