Skip to content

Commit

Permalink
Potential fix for code scanning alert no. 20: Information exposure th…
Browse files Browse the repository at this point in the history
…rough an exception

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
  • Loading branch information
1 parent 3440b39 commit 883c388
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions services/api/src/api/ollama_routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def copy():
return self.proxy.copy()
except Exception as e:
logger.error(f"Error in copy endpoint: {e}")
return {"error": str(e)}, 500
return {"error": "An internal error has occurred!"}, 500

@self.app.route("/api/delete", methods=["DELETE"])
@require_api_key
Expand All @@ -88,7 +88,7 @@ def delete():
return self.proxy.delete()
except Exception as e:
logger.error(f"Error in delete endpoint: {e}")
return {"error": str(e)}, 500
return {"error": "An internal error has occurred!"}, 500

@self.app.route("/api/pull", methods=["POST"])
@require_api_key
Expand All @@ -97,7 +97,7 @@ def pull():
return self.proxy.pull()
except Exception as e:
logger.error(f"Error in pull endpoint: {e}")
return {"error": str(e)}, 500
return {"error": "An internal error has occurred!"}, 500

@self.app.route("/api/push", methods=["POST"])
@require_api_key
Expand All @@ -106,7 +106,7 @@ def push():
return self.proxy.push()
except Exception as e:
logger.error(f"Error in push endpoint: {e}")
return {"error": str(e)}, 500
return {"error": "An internal error has occurred!"}, 500

# Blob management endpoints
@self.app.route("/api/blobs/<digest>", methods=["HEAD"])
Expand Down

0 comments on commit 883c388

Please sign in to comment.