Skip to content

Commit

Permalink
- Error messages are simplified in release mode
Browse files Browse the repository at this point in the history
- Fix Readme
- Remove `pp` in spec for  FTS
  • Loading branch information
Yacine Petitprez committed Aug 10, 2018
1 parent 8659fe2 commit 6a0aece
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 13 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@

Clear is an ORM built specifically for PostgreSQL in Crystal.

It's probably the most advanced ORM in term of features offered. It features
Active Record pattern models, and low-level SQL builder.
It's probably the most advanced ORM for PG on Crystal in term of features offered.
It features Active Record pattern models, and low-level SQL builder.

You can deal out of the box with jsonb, tsvectors, cursors, CTE, bcrypt password,
array, uuid primary key, foreign constraints... and other things !
Expand Down
2 changes: 1 addition & 1 deletion spec/extensions/full_text_searchable_spec.cr
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ module FullTextSearchableSpec
Series.create!({title: "",
description: ""})

Series.query.each { |s| pp s.tsv.to_db }
Series.query.each { |s| s.tsv.to_db }
end
end

Expand Down
24 changes: 14 additions & 10 deletions src/clear/error_messages.cr
Original file line number Diff line number Diff line change
Expand Up @@ -65,16 +65,20 @@ module Clear::ErrorMessages
end

def build_error_message(message : String, ways_to_resolve : Tuple = Tuple.new, manual_pages : Tuple = Tuple.new)
format_width({
build_message(message),
build_tips(ways_to_resolve),
build_manual(manual_pages),
(
"Your may also have encountered a bug. \n"+
"Feel free to fill an issue: \n#{build_url("https://github.com/anykeyh/clear/issues/new")}"
),
"\n\nStack trace:\n"
}.join)
{% if flag?(:release) %}
message
{% else %}
format_width({
build_message(message),
build_tips(ways_to_resolve),
build_manual(manual_pages),
(
"Your may also have encountered a bug. \n"+
"Feel free to fill an issue: \n#{build_url("https://github.com/anykeyh/clear/issues/new")}"
),
"\n\nStack trace:\n"
}.join)
{%end %}
end

def migration_already_up(number)
Expand Down

0 comments on commit 6a0aece

Please sign in to comment.