GithubHelp home page GithubHelp logo

Comments (4)

softprops avatar softprops commented on July 18, 2024

That could be something I can potentially improve on. I thought I had that but it looks like I'm wrong. If the error less throws contains a property for the line number the error occured on, ect there's not reason why I can't expose that too. Thanks for the feedback. I would find this very helpful too!

from less-sbt.

jrudolph avatar jrudolph commented on July 18, 2024

I just tried with this mess:

  case e : JavaScriptException =>
    println(e.details())
    e.getValue match {
      case v: Scriptable =>
        val props = "message name type filename line column callLine callExtract stack extract".split(" ").toSeq
        val values = props.map(p => (p, if (v.has(p, v)) Some(v.get(p, v)) else None))
        println(values)
        println(v.getIds.mkString(", "))
        //println(ScriptRuntime.defaultObjectToSource())
        val toSource = ScriptableObject.getProperty(v, "toSource").asInstanceOf[Function]
        val source = println(toSource.call(ctx, scope, v, ScriptRuntime.emptyArgs))

        val extract = v.get("extract", v).asInstanceOf[NativeArray]
        val ex = (0 until extract.getLength.toInt) map (i => extract.get(i))
        println(ex)

        sys.error(ScriptableObject.getProperty(v, "message").toString)

And that's what I'm getting out of there:

[object Object]
ArrayBuffer((message,Some(error evaluating function `darken`)), (name,None), (type,Some(org.mozilla.javascript.Undefined@42538425)), (filename,Some(null)), (line,Some(239.0)), (column,Some(10.0)), (callLine,Some(org.mozilla.javascript.Undefined@42538425)), (callExtract,Some(org.mozilla.javascript.Undefined@42538425)), (stack,Some(org.mozilla.javascript.Undefined@42538425)), (extract,Some(org.mozilla.javascript.NativeArray@7908bb27)))
type, message, filename, index, line, callLine, callExtract, stack, column, extract
({type:undefined, message:"error evaluating function `darken`", filename:null, index:4969, line:239, callLine:undefined, callExtract:undefined, stack:undefined, column:10, extract:["\t\t\tborder-bottom: 1/14em solid darken(@cmhb, 20%);", "\t\t\tcolor: darken(white, 2%);", "\t\t\tfont-size: 12/14em;"]})
Vector(         border-bottom: 1/14em solid darken(@cmhb, 20%);,            color: darken(white, 2%);,          font-size: 12/14em;)

from less-sbt.

softprops avatar softprops commented on July 18, 2024

Whoa thanks! I can't really look at this at work. The soonest I can look into this issue is tonight.

from less-sbt.

jrudolph avatar jrudolph commented on July 18, 2024

Yes, of course. There's no hurry.

from less-sbt.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.