Commit fdf09537 authored by Andrei Mihu's avatar Andrei Mihu
Browse files

Script runtime RPC and HTTP hook errors now return more detail when verbose logging is enabled

parent 3a28e99f
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -4,6 +4,8 @@ All notable changes to this project are documented below.
The format is based on [keep a changelog](http://keepachangelog.com/) and this project uses [semantic versioning](http://semver.org/).

### [Unreleased]
### Changed
- Script runtime RPC and HTTP hook errors now return more detail when verbose logging is enabled.

## [1.0.2] - 2017-09-29
### Added
+1 −1
Original line number Diff line number Diff line
@@ -36,7 +36,7 @@ func (p *pipeline) rpc(logger *zap.Logger, session *session, envelope *Envelope)
	result, fnErr := p.runtime.InvokeFunctionRPC(lf, session.userID, session.handle.Load(), session.expiry, rpcMessage.Payload)
	if fnErr != nil {
		logger.Error("Runtime RPC function caused an error", zap.String("id", rpcMessage.Id), zap.Error(fnErr))
		if apiErr, ok := fnErr.(*lua.ApiError); ok {
		if apiErr, ok := fnErr.(*lua.ApiError); ok && !p.config.GetLog().Verbose {
			msg := apiErr.Object.String()
			if strings.HasPrefix(msg, lf.Proto.SourceName) {
				msg = msg[len(lf.Proto.SourceName):]
+1 −1
Original line number Diff line number Diff line
@@ -231,7 +231,7 @@ func (a *authenticationService) configure() {
		responseData, funError := a.runtime.InvokeFunctionHTTP(fn, uuid.Nil, "", 0, payload)
		if funError != nil {
			a.logger.Error("Runtime function caused an error", zap.String("path", path), zap.Error(funError))
			if apiErr, ok := funError.(*lua.ApiError); ok {
			if apiErr, ok := funError.(*lua.ApiError); ok && !a.config.GetLog().Verbose {
				msg := apiErr.Object.String()
				if strings.HasPrefix(msg, fn.Proto.SourceName) {
					msg = msg[len(fn.Proto.SourceName):]