Error stack tracebacks?

Ouverte
#87 0 commentaires 3 réactions 0 personnes assignées Voir sur GitHub

Personne n'a encore pris cette issue.

Évaluation

Difficulté
4/5
Temps estimé
3-5 jours
Accessibilité débutants
18/100
Type d'issue
Fonctionnalité
Clarté
À clarifier
Activité
À l'abandon
Stack technique
go, lua
Domaine
compilers

Piste de recherche

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.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

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?

Langage dominant
Go
Étoiles
3.5k
Forks
217
Métriques de merge des PR
Aucune PR mergée en 30 j

Préparer son environnement

Ce projet ne fournit ni conteneur de développement, ni Dockerfile, ni guide de contribution : l'installation est à votre charge. Commencez par son README, et consultez notre guide de la première contribution pour les étapes générales.

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de Shopify/go-lua

Toutes les issues de Shopify/go-lua

Issues similaires

Plus d'issues Go

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.