<p dir="auto">When a callback is called by GLFW I get no line information about where the error was thrown. Here's an example:</p>
<div class="highlight highlight-source-julia notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import GLFW
GLFW.Init()
w = GLFW.CreateWindow(640, 480, &quot;&quot;)

function foo()
    GLFW.Terminate()
    throw(InexactError())
end

GLFW.SetWindowSizeCallback(w, (a, b, c) -&gt; foo())

while GLFW.WindowShouldClose(w) == 0
    GLFW.PollEvents()
end"><pre class="notranslate"><span class="pl-k">import</span> GLFW
GLFW<span class="pl-k">.</span><span class="pl-c1">Init</span>()
w <span class="pl-k">=</span> GLFW<span class="pl-k">.</span><span class="pl-c1">CreateWindow</span>(<span class="pl-c1">640</span>, <span class="pl-c1">480</span>, <span class="pl-s"><span class="pl-pds">"</span><span class="pl-pds">"</span></span>)

<span class="pl-k">function</span> <span class="pl-en">foo</span>()
    GLFW<span class="pl-k">.</span><span class="pl-c1">Terminate</span>()
    <span class="pl-c1">throw</span>(<span class="pl-c1">InexactError</span>())
<span class="pl-k">end</span>

GLFW<span class="pl-k">.</span><span class="pl-c1">SetWindowSizeCallback</span>(w, (a, b, c) <span class="pl-k">-&gt;</span> <span class="pl-c1">foo</span>())

<span class="pl-k">while</span> GLFW<span class="pl-k">.</span><span class="pl-c1">WindowShouldClose</span>(w) <span class="pl-k">==</span> <span class="pl-c1">0</span>
    GLFW<span class="pl-k">.</span><span class="pl-c1">PollEvents</span>()
<span class="pl-k">end</span></pre></div>
<p dir="auto">When resizing the window, the error message is:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="ERROR: InexactError()
 in error at error.jl:21
 in anonymous at /home/jhasse/.julia/v0.3/GLFW/src/GLFW.jl:22
 in ErrorCallback at /home/jhasse/.julia/v0.3/GLFW/src/util.jl:90
 in WindowSizeCallback at /home/jhasse/.julia/v0.3/GLFW/src/util.jl:56
 in anonymous at no file:13
 in include at ./boot.jl:245
 in include_from_node1 at loading.jl:128
 in process_options at ./client.jl:285
 in _start at ./client.jl:354
 in _start_3B_1718 at /usr/bin/../lib/x86_64-linux-gnu/julia/sys.so
while loading /home/jhasse/test.jl, in expression starting on line 12"><pre class="notranslate"><code class="notranslate">ERROR: InexactError()
 in error at error.jl:21
 in anonymous at /home/jhasse/.julia/v0.3/GLFW/src/GLFW.jl:22
 in ErrorCallback at /home/jhasse/.julia/v0.3/GLFW/src/util.jl:90
 in WindowSizeCallback at /home/jhasse/.julia/v0.3/GLFW/src/util.jl:56
 in anonymous at no file:13
 in include at ./boot.jl:245
 in include_from_node1 at loading.jl:128
 in process_options at ./client.jl:285
 in _start at ./client.jl:354
 in _start_3B_1718 at /usr/bin/../lib/x86_64-linux-gnu/julia/sys.so
while loading /home/jhasse/test.jl, in expression starting on line 12
</code></pre></div>
<p dir="auto">I should point me to line 7 (<code class="notranslate">throw(InexactError())</code>).</p>
<p dir="auto">Unfortunately I wasn't able to create a minimal working example without using GLFW, sorry. I'm not sure what exactly causes this.</p>
<p dir="auto">It seems that julia error tracebacks sometimes leave out some lines, including the one with the actual error.<br>
When I load the following code from a script,</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="module M
function f()
    x        # line 3: error occurs here
end
function g()
    f()      # line 6
end
g()          # line 8
end"><pre class="notranslate"><code class="notranslate">module M
function f()
    x        # line 3: error occurs here
end
function g()
    f()      # line 6
end
g()          # line 8
end
</code></pre></div>
<p dir="auto">it produces the output</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="in g: x not defined
 in load at util.jl:230
 in load at util.jl:242
at /work/toivo/code/juliastuff/code/errorline.jl:8
 in load at util.jl:253"><pre class="notranslate"><code class="notranslate">in g: x not defined
 in load at util.jl:230
 in load at util.jl:242
at /work/toivo/code/juliastuff/code/errorline.jl:8
 in load at util.jl:253
</code></pre></div>
<p dir="auto">Note that both line 3, where the error occurs, and line 6, which calls it, are missing from the traceback.</p>