Skip to content

Commit

Permalink
fix: change error message when validating env configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
zobo committed Apr 24, 2022
1 parent 8eac6d6 commit 790999c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/).

## [1.26.1]

- Fixed typo in error message for unexpected env. Extended error message with more detail.

## [1.26.0]

- Support for Unix Domain sockets #777
Expand Down
6 changes: 5 additions & 1 deletion src/phpDebug.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ function formatPropertyValue(property: xdebug.BaseProperty): string {
* This interface should always match the schema found in the mock-debug extension manifest.
*/
export interface LaunchRequestArguments extends VSCodeDebugProtocol.LaunchRequestArguments {
/** Name of the configuration */
name?: string
/** The address to bind to for listening for Xdebug connections (default: all IPv6 connections if available, else all IPv4 connections) or unix socket */
hostname?: string
/** The port where the adapter should listen for Xdebug connections (default: 9003) */
Expand Down Expand Up @@ -487,7 +489,9 @@ class PhpDebugSession extends vscode.DebugSession {
try {
// Some checks
if (args.env !== undefined && args.program === undefined && args.runtimeArgs === undefined) {
throw new Error('Cannot set env without running a program (or ')
throw new Error(
`Cannot set env without running a program.\nPlease remove env from [${args.name}] configuration.`
)
}
if (
(args.hostname?.toLowerCase()?.startsWith('unix://') === true ||
Expand Down

0 comments on commit 790999c

Please sign in to comment.