@@ -22,6 +22,7 @@ class Configuration
2222 :top_level_meta_include_page_count ,
2323 :top_level_meta_page_count_key ,
2424 :allow_transactions ,
25+ :include_backtraces_in_errors ,
2526 :exception_class_whitelist ,
2627 :always_include_to_one_linkage_data ,
2728 :always_include_to_many_linkage_data ,
@@ -68,6 +69,10 @@ def initialize
6869
6970 self . use_text_errors = false
7071
72+ # Whether or not to include exception backtraces in JSONAPI error
73+ # responses. Defaults to `false` in production, and `true` otherwise.
74+ self . include_backtraces_in_errors = !Rails . env . production?
75+
7176 # List of classes that should not be rescued by the operations processor.
7277 # For example, if you use Pundit for authorization, you might
7378 # raise a Pundit::NotAuthorizedError at some point during operations
@@ -212,6 +217,8 @@ def default_processor_klass=(default_processor_klass)
212217
213218 attr_writer :allow_transactions
214219
220+ attr_writer :include_backtraces_in_errors
221+
215222 attr_writer :exception_class_whitelist
216223
217224 attr_writer :always_include_to_one_linkage_data
0 commit comments