         readyTimeout = setTimeout resolve, SW_CONNECT_TIMEOUT_MS
 
         navigator.serviceWorker.ready
-        .catch -> null
+        .catch ->
+          console.log 'caught sw error'
+          null
         .then (registration) =>
           worker = registration?.active
           if worker

    .catch -> null

    @swValidation = @ready.then =>
      @sw.call 'ping', null, {timeout: @handshakeTimeout}
    .then (registeredMethods) =>
      @parentsRegisteredMethods = @parentsRegisteredMethods.concat(
        registeredMethods

RPCClient = require './rpc_client'

DEFAULT_HANDSHAKE_TIMEOUT_MS = 10000 # 10 seconds
SW_CONNECT_TIMEOUT_MS = 5000 # 5s

selfWindow = if window? then window else self

