Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Empty less file causes Unexpected exception #38

Closed
Enalmada opened this issue Jul 30, 2014 · 1 comment
Closed

Empty less file causes Unexpected exception #38

Enalmada opened this issue Jul 30, 2014 · 1 comment

Comments

@Enalmada
Copy link

It was nearly impossible for me to know why and what to do from this error after making lots of changes at the same time to migrate to new version of play. Who would have thought this error has anything to do with empty less file.

play.PlayExceptions$UnexpectedException: Unexpected exception[DeserializationException: Expected Int as JsNumber, but got null]
    at play.PlayReloader$$anon$1$$anonfun$play$PlayReloader$$anon$$taskFailureHandler$1.apply(PlayReloader.scala:236) ~[na:na]
    at play.PlayReloader$$anon$1$$anonfun$play$PlayReloader$$anon$$taskFailureHandler$1.apply(PlayReloader.scala:229) ~[na:na]
    at scala.Option.map(Option.scala:145) ~[scala-library-2.11.1.jar:na]
    at play.PlayReloader$$anon$1.play$PlayReloader$$anon$$taskFailureHandler(PlayReloader.scala:229) ~[na:na]
    at play.PlayReloader$$anon$1$$anonfun$reload$2.apply(PlayReloader.scala:89) ~[na:na]
Caused by: spray.json.DeserializationException: Expected Int as JsNumber, but got null
    at spray.json.package$.deserializationError(package.scala:23) ~[na:na]
    at spray.json.BasicFormats$IntJsonFormat$.read(BasicFormats.scala:29) ~[na:na]
    at spray.json.BasicFormats$IntJsonFormat$.read(BasicFormats.scala:25) ~[na:na]
    at spray.json.JsValue.convertTo(JsValue.scala:32) ~[na:na]
    at com.typesafe.sbt.jse.SbtJsTask$JsTaskProtocol$LineBasedProblemFormat$$anonfun$read$7.apply(SbtJsTask.scala:117) ~[na:na]
@huntc
Copy link
Contributor

huntc commented Aug 4, 2014

I'm not sure what to do about this other than suggest configuring the engine to use Node; perhaps the error output is better then. I'd be interested to know in case you'd care to try.

Right now we're translating errors reported from Trireme as per the following:

      script.execute.setListener(new ScriptStatusListener {
        def onComplete(script: NodeScript, status: ScriptStatus): Unit = {
          if (status.hasCause) {
            try {
              status.getCause match {
                case e: RhinoException =>
                  stderrOs.write(e.getLocalizedMessage.getBytes("UTF-8"))
                  stderrOs.write(e.getScriptStackTrace.getBytes("UTF-8"))
                case t =>
                  t.printStackTrace(new PrintStream(stderrOs))
              }
            } catch {
              case e: Throwable =>
                if (e.isInstanceOf[AskTimeoutException] || status.getCause.isInstanceOf[AskTimeoutException]) {
                  log.error(e, "Received a timeout probably because stdio sinks and sources were closed early given a timeout waiting for the JS to execute. Increase the timeout.")
                } else {
                  log.error(status.getCause, "Problem completing Trireme. Throwing exception, meanwhile here's the Trireme problem")
                  throw e
                }
            }
          }
          stdoutOs.close()
          stderrOs.close()
          senderSys.actorSelection(senderSel) ! status.getExitCode
        }
      })

@gbrail Do you have any other thoughts?

Closing for now though as I don't think this is something we can do anything about. Happy to re-open if it turns out that there is something to be done. Btw: JS itself is rubbish as a language in preventing this type of thing from happening. :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants