Skip to content

Commit

Permalink
[ENHANCEMENT] Add Google Analytics to docs (#5366)
Browse files Browse the repository at this point in the history
# Description
<!-- Please include a summary of the changes and the related issue.
Please also include relevant motivation and context. List any
dependencies that are required for this change. -->

Closes #5365

**Type of change**
<!-- Please delete options that are not relevant. Remember to title the
PR according to the type of change -->

- Documentation update

**How Has This Been Tested**
<!-- Please add some reference about how your feature has been tested.
-->

**Checklist**
<!-- Please go over the list and make sure you've taken everything into
account -->

- I added relevant documentation
- I followed the style guidelines of this project
- I did a self-review of my code
- I made corresponding changes to the documentation
- I confirm My changes generate no new warnings
- I have added tests that prove my fix is effective or that my feature
works
- I have added relevant notes to the CHANGELOG.md file (See
https://keepachangelog.com/)

---------

Co-authored-by: burtenshaw <[email protected]>
  • Loading branch information
davidberenstein1957 and burtenshaw authored Aug 7, 2024
1 parent 1275c54 commit fbb3589
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
18 changes: 17 additions & 1 deletion argilla/mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,23 @@ extra:
link: https://www.youtube.com/channel/UCAIz8TmvQQrLqbD7sd-5S2A
- icon: fontawesome/brands/discord
link: http://hf.co/join/discord

analytics:
provider: google
property: G-T5RMYPJ1B2
feedback:
title: Was this page helpful?
ratings:
- icon: material/thumb-up-outline
name: This page was helpful
data: 1
note: >-
Thanks for your feedback!
- icon: material/thumb-down-outline
name: This page could be improved
data: 0
note: >-
Thanks for your feedback! Help us improve this page by
<a href="https://github.com/argilla-io/argilla/issues/new/?title=[Feedback]+{title}+-+{url}" target="_blank" rel="noopener">opening a GitHub issue</a>.
extra_css:
- stylesheets/extra.css

Expand Down
4 changes: 3 additions & 1 deletion argilla/src/argilla/_exceptions/_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@


class ArgillaAPIError(ArgillaError):
message = "Server error"

def __init__(self, message: Optional[str] = None, status_code: int = 500):
"""Base class for all Argilla API exceptions
Args:
Expand Down Expand Up @@ -82,7 +84,7 @@ def _error_switch(status_code: int, error_detail: str):
500: InternalServerError,
}
exception_class = switch.get(status_code, ArgillaAPIError)
raise exception_class(f"{exception_class.message}. Details: {error_detail}")
raise exception_class(f"{exception_class.message}. Details: {error_detail}", status_code=status_code)

def _handler_wrapper(*args, **kwargs):
try:
Expand Down

0 comments on commit fbb3589

Please sign in to comment.