Accessing JS error object from MiniRacer::EvalError?
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 35/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bastante claro
- Estado de actividad
- Estancado
- Stack tecnológico
- javascript, ruby
- Área
- backend
Línea de trabajo
Start by reading the MiniRacer::EvalError and MiniRacer::Context#eval implementation, then inspect the tests for evaluation errors and backtraces. Determine whether the JavaScript error object and its custom attributes can be exposed while preserving source line numbers; done means the issue's use case works without wrapper-induced backtrace offsets. The discussion has had no recent activity, so check its thread before starting.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
I'm wondering how I can access the JavaScript error object from MiniRacer::EvalError.
I want to run script snippets from users and I want to report errors to them. We have some extended attributes on custom errors which I would need to access.
The only way I found to solve this is by wrapping the script before sending it to MiniRacer::Context#eval like this:
wrapper = <<~JS
try {
#{script}
}
catch(err) {
var thrownError = err;
}
JS
context.eval(wrapper)
With this I can access thrownError. But my issue is, that line numbers in backtraces are off. My current solution is to have a map that contains offsets accounting for the wrapper script.
Is there any other way to achieve this?
- Lenguaje dominante
- JavaScript
- Estrellas
- 628
- Forks
- 100
- Merge medio
- 1 d 20 h
- PR fusionados (30 d)
- 2
Preparar el entorno
- Incluye un Dockerfile o un archivo de Docker Compose
- Sin plantilla de pull request
- Sin guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de rubyjs/mini_racer
-
bug/crash platform: linux/x86
Dificultad 4/5 3-5 días Aptitud para principiantes 42/100
rubyjs/mini_racer#422 · 10 comentarios ·
-
platform: darwin/x86
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
rubyjs/mini_racer#388 · 4 comentarios ·
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 20/100
rubyjs/mini_racer#376 ·
-
Load script as moduleAbierto
Dificultad 4/5 3-5 días Aptitud para principiantes 45/100
rubyjs/mini_racer#353 ·
-
Dificultad 3/5 1-2 días Aptitud para principiantes 35/100
rubyjs/mini_racer#346 · 6 comentarios · 1 reacción ·
Todos los issues de rubyjs/mini_racer
Issues similares
-
In game I can not see the teamsAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 63/100
oskarrough/dodgethis#115 ·
Los mantenedores suelen responder en 1 día
-
[Bug]: REST API URL starting with "http" but no scheme (e.g. httpbin.org/get) is not given an http:// prefixPosiblemente ocupada @ItsDeadlyProgrammer la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
appsmithorg/appsmith#42471 · 1 comentario ·
Los mantenedores suelen responder en 2 días
-
[External Plugin]: reelaryAbiertoexternal-plugin requires-submitter-fixes
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
github/awesome-copilot#5396 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
chenasraf/nextcloud-forum#348 ·
-
needs-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
melodic-software/claude-code-plugins#9619 ·
Los mantenedores suelen responder en 1 día