Error stack tracebacks?

Aberta
#87 0 comentários 3 reações 0 responsáveis Ver no GitHub

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
4/5
Tempo estimado
3-5 dias
Facilidade para iniciantes
18/100
Tipo de issue
Funcionalidade
Clareza
Precisa de esclarecimento
Status de atividade
Estagnada
Stack de tecnologia
go, lua
Domínio
compilers

Direção de pesquisa

The report compares the lua CLI traceback with the error printed by the README example lua-test.go, which shows only runtime error: hello.lua:6: attempt to call a nil value. Start by running lua-test.go with the hello.lua script from the issue to reproduce that output. Done would mean either a documented way to get a stack traceback from go-lua or a clear statement that this is not supported. The thread has no maintainer reply, so confirm the intended behaviour before writing code.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

Hi there!

(little disclaimer first: I'm not terribly familiar with go)

I'm struggling a bit on how to get proper tracebacks for errors using go-lua.

Giving this hello.lua file, containing:

print("Hello World")

function foo()
  print("Hello, I'm foo!")
  bar()
end

foo()

…run with lua hello.lua gives me:

Hello World
Hello, I'm foo!
lua: hello.lua:5: attempt to call global 'bar' (a nil value)
stack traceback:
	hello.lua:5: in function 'foo'
	hello.lua:8: in main chunk
	[C]: in ?

If I run this with the example provided in the README, I get:

go run lua-test.go
Hello World
Hello, I'm foo!
2017/08/03 11:38:42 runtime error: hello.lua:6: attempt to call a nil value

How can I get a comparable traceback with go-lua? Something that can be presented to a user. Are there more examples somewhere?

Linguagem predominante
Go
Estrelas
3.5k
Forks
217
Métricas de merge de PRs
Nenhum PR com merge em 30d

Preparar o ambiente

Este projeto não oferece contêiner de desenvolvimento, Dockerfile nem guia de contribuição, então a configuração fica por sua conta: comece pelo README e veja nosso guia da primeira contribuição para os passos gerais.

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de Shopify/go-lua

Todas as issues de Shopify/go-lua

Issues semelhantes

Mais issues de Go

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.