---
editLink: false
lastUpdated: false
---

[@salesforce/b2c-tooling-sdk](../../modules.md) / [security](../index.md) / classifyParseError

# Function: classifyParseError()

> **classifyParseError**(`text`, `line`): [`ScriptParseErrorReason`](../type-aliases/ScriptParseErrorReason.md)

Defined in: [packages/b2c-tooling-sdk/src/security/script/runner.ts:63](https://github.com/SalesforceCommerceCloud/b2c-developer-tooling/blob/d7ff38c7ca2b1411cd718b9554500c9416f00266/packages/b2c-tooling-sdk/src/security/script/runner.ts#L63)

Classifies a parse failure by the line it happened on: legacy `.ds`-style
type annotations (`var x : String`), E4X XML (`<product/>`, `x..y`, `ns::a`),
or any other syntax error. Both legacy syntaxes run on the platform but are
not standard JavaScript, so the scanner can't analyze those files.

## Parameters

### text

`string`

### line

`number` | `undefined`

## Returns

[`ScriptParseErrorReason`](../type-aliases/ScriptParseErrorReason.md)
