Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: AlchemyCMS/alchemy-json_api
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.6.0
Choose a base ref
...
head repository: AlchemyCMS/alchemy-json_api
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v0.7.0
Choose a head ref
  • 3 commits
  • 3 files changed
  • 2 contributors

Commits on Nov 13, 2020

  1. Log errors into standard out

    We want better error visibility.
    mamhoff committed Nov 13, 2020
    Copy the full SHA
    7ad18e7 View commit details
  2. Merge pull request #16 from AlchemyCMS/better-errors

    Log errors into standard out
    tvdeyen authored Nov 13, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    8f738c2 View commit details

Commits on Nov 16, 2020

  1. Bump version to 0.7.0

    Log errors into standard out [\#16](#16) ([mamhoff](https://github.com/mamhoff))
    tvdeyen committed Nov 16, 2020

    Verified

    This commit was signed with the committer’s verified signature. The key has expired.
    tvdeyen Thomas von Deyen
    Copy the full SHA
    919d2e4 View commit details
Showing with 26 additions and 1 deletion.
  1. +8 −0 CHANGELOG.md
  2. +17 −0 app/controllers/alchemy/json_api/base_controller.rb
  3. +1 −1 lib/alchemy/json_api/version.rb
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## [v0.7.0](https://github.com/AlchemyCMS/alchemy-json_api/tree/v0.7.0) (2020-11-16)

[Full Changelog](https://github.com/AlchemyCMS/alchemy-json_api/compare/v0.6.0...v0.7.0)

**Merged pull requests:**

- Log errors into standard out [\#16](https://github.com/AlchemyCMS/alchemy-json_api/pull/16) ([mamhoff](https://github.com/mamhoff))

## [v0.6.0](https://github.com/AlchemyCMS/alchemy-json_api/tree/v0.6.0) (2020-11-12)

[Full Changelog](https://github.com/AlchemyCMS/alchemy-json_api/compare/v0.5.0...v0.6.0)
17 changes: 17 additions & 0 deletions app/controllers/alchemy/json_api/base_controller.rb
Original file line number Diff line number Diff line change
@@ -7,6 +7,23 @@ class BaseController < ::ApplicationController
include JSONAPI::Errors
include JSONAPI::Filtering
include JSONAPI::Pagination

private

def render_jsonapi_internal_server_error(exception)
log_error(exception)
super
end

def log_error(exception)
logger = Rails.logger
return unless logger

message = +"\n#{exception.class} (#{exception.message}):\n"
message << exception.annotated_source_code.to_s if exception.respond_to?(:annotated_source_code)
message << " " << exception.backtrace.join("\n ")
logger.fatal("#{message}\n\n")
end
end
end
end
2 changes: 1 addition & 1 deletion lib/alchemy/json_api/version.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# frozen_string_literal: true
module Alchemy
module JsonApi
VERSION = "0.6.0"
VERSION = "0.7.0"
end
end