{"record":{"id":"1d0c1197841d4561","repo":"sickn33/agentic-awesome-skills","slug":"user-already-exists","errorCode":null,"errorMessage":"User already exists","messagePattern":"User already exists","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"skills/javascript-testing-patterns/resources/implementation-playbook.md","lineNumber":136,"sourceCode":"    });\n\n    it('should throw error when dividing by zero', () => {\n      expect(() => divide(10, 0)).toThrow('Division by zero');\n    });\n  });\n});\n```\n\n### Pattern 2: Testing Classes\n\n```typescript\n// services/user.service.ts\nexport class UserService {\n  private users: Map<string, User> = new Map();\n\n  create(user: User): User {\n    if (this.users.has(user.id)) {\n      throw new Error('User already exists');\n    }\n    this.users.set(user.id, user);\n    return user;\n  }\n\n  findById(id: string): User | undefined {\n    return this.users.get(id);\n  }\n\n  update(id: string, updates: Partial<User>): User {\n    const user = this.users.get(id);\n    if (!user) {\n      throw new Error('User not found');\n    }\n    const updated = { ...user, ...updates };\n    this.users.set(id, updated);\n    return updated;\n  }","sourceCodeStart":118,"sourceCodeEnd":154,"githubUrl":"https://github.com/sickn33/agentic-awesome-skills/blob/58d857988fcfac6986206bca2b2fe223aa437e4b/skills/javascript-testing-patterns/resources/implementation-playbook.md#L118-L154","documentation":"Error \"User already exists\" thrown in sickn33/agentic-awesome-skills.","triggerScenarios":"Thrown at skills/javascript-testing-patterns/resources/implementation-playbook.md:136 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"58d857988fcfac6986206bca2b2fe223aa437e4b","analyzedAt":"2026-08-26T11:55:59.350Z","schemaVersion":2},"datasetVersion":"2026-08-26T14:46:13.012Z"}