Skip to content

Commit 2625112

Browse files
committed
update invalid boundary error message
1 parent 728c5e7 commit 2625112

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Multipart.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ export class Multipart implements Part {
6565
public constructor(public readonly parts: Part[], boundary: Uint8Array | string = crypto.randomUUID(), mediaType: string = "multipart/mixed") {
6666
this.#boundary = typeof boundary === "string" ? new TextEncoder().encode(boundary) : boundary;
6767
if (!Multipart.isValidBoundary(this.#boundary))
68-
throw new RangeError("Boundary must be 1 to 70 characters long, not end with space, and may only contain: A-Z a-z 0-9 '()+_,-./:=? and space");
68+
throw new RangeError("Invalid boundary: must be 1 to 70 characters long, not end with space, and may only contain: A-Z a-z 0-9 '()+_,-./:=? and space");
6969
this.#mediaType = mediaType;
7070
this.setHeaders();
7171
}
@@ -121,7 +121,7 @@ export class Multipart implements Part {
121121
public set boundary(boundary: Uint8Array | string) {
122122
this.#boundary = typeof boundary === "string" ? new TextEncoder().encode(boundary) : boundary;
123123
if (!Multipart.isValidBoundary(this.#boundary))
124-
throw new RangeError("Boundary must be 1 to 70 characters long, not end with space, and may only contain: A-Z a-z 0-9 '()+_,-./:=? and space");
124+
throw new RangeError("Invalid boundary: must be 1 to 70 characters long, not end with space, and may only contain: A-Z a-z 0-9 '()+_,-./:=? and space");
125125
this.setHeaders();
126126
}
127127

0 commit comments

Comments
 (0)