Skip to content

Commit

Permalink
allow full error log
Browse files Browse the repository at this point in the history
adding turncate in different places

further truncate
  • Loading branch information
nimrodshn committed Dec 11, 2017
1 parent d66dbcc commit f74b454
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/models/authentication.rb
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def validation_successful
def validation_failed(status = :unreachable, message = nil)
message ||= ERRORS[status]
_log.warn("[#{resource_type}] [#{resource_id}], previously valid on: #{last_valid_on}, previous status: [#{self.status}]")
update_attributes(:status => status.to_s.capitalize, :status_details => message.to_s, :last_invalid_on => Time.now.utc)
update_attributes(:status => status.to_s.capitalize, :status_details => message.to_s.truncate(200), :last_invalid_on => Time.now.utc)
raise_event(status, message)
end

Expand Down
6 changes: 3 additions & 3 deletions app/models/mixins/authentication_mixin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ def authentication_check(*args)
status == :valid ? auth.validation_successful : auth.validation_failed(status, details)
end

return status == :valid, details
return status == :valid, details.truncate(20000)
end

def default_authentication
Expand All @@ -360,9 +360,9 @@ def authentication_check_no_validation(type, options)
end
end

details &&= details.to_s.truncate(200)
details &&= details.to_s

_log.warn("#{header} Validation failed: #{status}, #{details}") unless status == :valid
_log.warn("#{header} Validation failed: #{status}, #{details.truncate(200)}") unless status == :valid
return status, details
end

Expand Down

0 comments on commit f74b454

Please sign in to comment.