* websocket-gateway GATEWAY_NAME fixes

This commit is contained in:
Seth Call 2014-09-25 20:40:31 -05:00
parent 9442e34297
commit f4ef6b2360
5 changed files with 13 additions and 5 deletions

View File

@ -671,6 +671,7 @@ message ServerGenericError {
// but gives the client a chance to know why.
message ServerRejectionError {
optional string error_msg = 1;
optional string error_code = 2;
}
// route_to: client

View File

@ -650,7 +650,7 @@ module JamWebsockets
send_to_client(client, login_ack)
end
else
raise SessionError, 'invalid login'
raise SessionError, 'invalid login', 'invalid_login'
end
end
@ -766,7 +766,7 @@ module JamWebsockets
return nil
end
else
raise SessionError, 'no login data was found in Login message'
raise SessionError, 'no login data was found in Login message', 'invalid_login'
end
end

View File

@ -27,7 +27,7 @@ module JamWebsockets
calling_thread = options[:calling_thread]
trust_check = TrustCheck.new(trust_port, options[:cidr])
@log.info "starting server #{host}:#{port} staleness_time=#{connect_time_stale_client}; reconnect time = #{connect_time_expire_client}, rabbitmq=#{rabbitmq_host}:#{rabbitmq_port}"
@log.info "starting server #{host}:#{port} staleness_time=#{connect_time_stale_client}; reconnect time = #{connect_time_expire_client}, rabbitmq=#{rabbitmq_host}:#{rabbitmq_port} gateway_name=#{gateway_name}"
EventMachine.error_handler{|e|
@log.error "unhandled error #{e}"

View File

@ -1,4 +1,11 @@
class SessionError < Exception
class SessionError < StandardError
attr_accessor :error_code
def initialize(msg, error_code = nil)
super(msg)
@error_code = error_code
end
end

View File

@ -24,7 +24,7 @@ main()
# and bundle won't run because it thinks it has the wrong versions of gems
rm -f Gemfile.lock
JAM_INSTANCE=$JAM_INSTANCE BUILD_NUMBER=$BUILD_NUMBER JAMENV=production exec bundle exec ruby -Ilib bin/websocket_gateway
GATEWAY_NAME="$GATEWAY_NAME" JAM_INSTANCE=$JAM_INSTANCE BUILD_NUMBER=$BUILD_NUMBER JAMENV=production exec bundle exec ruby -Ilib bin/websocket_gateway
}
[ "$#" -ne 1 ] && ( usage && exit 1 ) || main