add the industry name to assist with debugging when error occurs

This commit is contained in:
phyzical 2022-02-04 17:46:08 +08:00
parent 608cc089b2
commit 105ea19eae

@ -17,7 +17,7 @@ import { ResearchMap } from "./ResearchMap";
export function NewIndustry(corporation: ICorporation, industry: string, name: string): void {
if (corporation.divisions.find(({ type }) => industry == type))
throw new Error("You have already expanded into this industry!");
throw new Error(`You have already expanded into the ${industry} industry!`);
for (let i = 0; i < corporation.divisions.length; ++i) {
if (corporation.divisions[i].name === name) {