note-connector 0.2.9 → 0.2.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "note-connector",
3
- "version": "0.2.9",
3
+ "version": "0.2.11",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
package/py/pyproject.toml CHANGED
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "note-connector"
3
- version = "0.2.9"
3
+ version = "0.2.11"
4
4
  description = "note-connector: MCP server and ChatGPT connector for note.com"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.13"
@@ -244,6 +244,17 @@ async def _upload_image_internal(
244
244
  async with NoteAPIClient(session) as client:
245
245
  response = await client.post(endpoint, files=files, data=data)
246
246
 
247
+ # Check for API-level error response
248
+ if "error" in response and not response.get("data"):
249
+ error_message = response.get("error", "unknown error")
250
+ if isinstance(error_message, dict):
251
+ error_message = error_message.get("message", str(error_message))
252
+ raise NoteAPIError(
253
+ code=ErrorCode.UPLOAD_FAILED,
254
+ message=f"画像アップロードに失敗しました: {error_message}",
255
+ details={"note_id": numeric_note_id, "response": response},
256
+ )
257
+
247
258
  # Debug: log full API response for investigation
248
259
  logger.debug(
249
260
  "Image upload response for note_id=%s, endpoint=%s: %s",