[PR #7326] [MERGED] add line numbers for parser errors #38259

Closed
opened 2026-04-22 22:55:57 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/7326
Author: @pdevine
Created: 10/23/2024
Status: Merged
Merged: 11/14/2024
Merged by: @pdevine

Base: mainHead: pdevine/parserlines


📝 Commits (1)

  • 6e82c7c add line numbers for parser errors

📊 Changes

2 files changed (+68 additions, -9 deletions)

View changed files

📝 parser/parser.go (+29 -3)
📝 parser/parser_test.go (+39 -6)

📄 Description

If a Modelfile has an error in it, it's often difficult to debug where the error is located in the Modelfile itself. This change adds the line which the error was detected on.

This changes:

Error: command must be one of "from", "license", "template", "system", "adapter", "parameter", or "message"

into something like this:

Error: (line 3): command must be one of "from", "license", "template", "system", "adapter", "parameter", or "message"

Fixes #7251


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ollama/ollama/pull/7326 **Author:** [@pdevine](https://github.com/pdevine) **Created:** 10/23/2024 **Status:** ✅ Merged **Merged:** 11/14/2024 **Merged by:** [@pdevine](https://github.com/pdevine) **Base:** `main` ← **Head:** `pdevine/parserlines` --- ### 📝 Commits (1) - [`6e82c7c`](https://github.com/ollama/ollama/commit/6e82c7cdde93c6665def761b04e3298c1f96d92e) add line numbers for parser errors ### 📊 Changes **2 files changed** (+68 additions, -9 deletions) <details> <summary>View changed files</summary> 📝 `parser/parser.go` (+29 -3) 📝 `parser/parser_test.go` (+39 -6) </details> ### 📄 Description If a Modelfile has an error in it, it's often difficult to debug where the error is located in the Modelfile itself. This change adds the line which the error was detected on. This changes: ``` Error: command must be one of "from", "license", "template", "system", "adapter", "parameter", or "message" ``` into something like this: ``` Error: (line 3): command must be one of "from", "license", "template", "system", "adapter", "parameter", or "message" ``` Fixes #7251 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-22 22:55:57 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#38259