/
githubmirror
/
grafana
Обзор
Документация
Войти
/
githubmirror
/
grafana
Код
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
pkg/api/frontendlogging/grafana_javascript_agent_sourcemaps.go
30 строк
775 B
Will Browne
Plugins: Add context to StaticRouteResolver and ErrorResolver interfaces (#73121)
10 авг 2023, 11:32
Не верифицирован
10 авг 2023, 11:32
d29f4a8
Код
Авторство
О чём код?
package frontendlogging import "context" // TransformException will attempt to resolve all modified source locations in the stacktrace with original source locations func TransformException(ctx context.Context, ex *Exception, store *SourceMapStore) *Exception { if ex.Stacktrace == nil { return ex } frames := []Frame{} for _, frame := range ex.Stacktrace.Frames { frame := frame mappedFrame, err := store.resolveSourceLocation(ctx, frame) if err != nil { frames = append(frames, frame) } else if mappedFrame != nil { frames = append(frames, *mappedFrame) } else { frames = append(frames, frame) } } return &Exception{ Type: ex.Type, Value: ex.Value, Stacktrace: &Stacktrace{Frames: frames}, Timestamp: ex.Timestamp, } }