(self, r: Response)
| 232 | error_handling: bool = True |
| 233 | |
| 234 | def check_response(self, r: Response): |
| 235 | if r.status_code == 403 or r.status_code == 401: |
| 236 | raise exceptions.Unauthorized(f"Request content: {r.content!r}") |
| 237 | if r.status_code == 500: |
| 238 | raise exceptions.APIError("Internal Scratch server error") |
| 239 | if r.status_code == 429: |
| 240 | raise exceptions.Response429("You are being rate-limited (or blocked) by Scratch") |
| 241 | if r.json() == {"code":"BadRequest","message":""}: |
| 242 | raise exceptions.BadRequest("Make sure all provided arguments are valid") |
| 243 | |
| 244 | @override |
| 245 | def get(self, *args, **kwargs): |
no test coverage detected