Skip to content

Commit 63c53d1

Browse files
committed
Document JSONAPI::Utils::Exceptions::InternalServerError
1 parent fab1885 commit 63c53d1

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

lib/jsonapi/utils/exceptions/active_record.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def initialize(object, resource_klass, context)
2727
@formatted_key = {}
2828
end
2929

30-
# Decorate errors from AR invalid objects.
30+
# Decorate errors for AR invalid objects.
3131
#
3232
# @note That's the method used by formatters to build the response's error body.
3333
#

lib/jsonapi/utils/exceptions/internal_server_error.rb

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,20 @@ module JSONAPI
22
module Utils
33
module Exceptions
44
class InternalServerError < ::JSONAPI::Exceptions::Error
5+
# HTTP status code
6+
#
7+
# @return [String]
8+
#
9+
# @api public
510
def code
611
'500'
712
end
813

14+
# Decorate errors for 500 responses.
15+
#
16+
# @return [Array]
17+
#
18+
# @api public
919
def errors
1020
[JSONAPI::Error.new(
1121
code: code,

0 commit comments

Comments
 (0)