-
Notifications
You must be signed in to change notification settings - Fork 11
add support to handle response #30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| # frozen_string_literal: true | ||
|
|
||
| # Fns Exceptions | ||
| module Fnsapi | ||
| class Error < ::StandardError; end | ||
|
|
||
| class APIError < Error; end | ||
|
|
||
| # status 400 | ||
| class FnsBadRequestError < APIError | ||
| def message | ||
| 'Не пройден форматно-логический контроль реквизитов фискальных документов' | ||
| end | ||
| end | ||
|
|
||
| # status 404 | ||
| class FnsNotFoundError < APIError | ||
| def message | ||
| 'Фискальный документ не найден в оперативном хранилище (сформирован более 2,5 месяцев назад)' | ||
| end | ||
| end | ||
|
|
||
| # status 406 | ||
| class FnsCryptoProtectionError < APIError | ||
| def message | ||
| 'Направленный фискальный признак не прошел проверку системы криптозащиты, поиск фискального документа прерван, дальнейшие попытки проверки запрещены' | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ФП не соответствует фискальным данным. Проверка невозможна. |
||
| end | ||
| end | ||
|
|
||
| # status 503 | ||
| class FnsServiceUnaviableError < APIError | ||
| def message | ||
| 'Недокументированная ошибка в работе сервиса, для выяснения причин следует обратиться в техподдержку, указав: URL запроса к сервису, текст запроса к сервису, текст ответа от сервиса.' | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Что-то пошло не так, напишите в техподдержку. Хорошо бы сразу ссылку или почту указать.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Не уверен с почтой, прямого доступа у меня к ней нет, но у них все таки выдача доступов по запросу, может там разные менеджеры на отдельную интеграцию. Тогда лучше наверное оставить просто как есть, а там уже на месте определяться, к кому обращаться с таким вопросом |
||
| end | ||
| end | ||
|
|
||
| class FnsUnknownError < APIError; end | ||
| end | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Переформулируйте, плиз, по-человечески. Из этого текста не ясно в чем дело)